Skip to content

Instantly share code, notes, and snippets.

@inouetakuya
Created October 20, 2013 03:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save inouetakuya/7064644 to your computer and use it in GitHub Desktop.
Save inouetakuya/7064644 to your computer and use it in GitHub Desktop.
sample test which generates document with autodoc
# spec/requests/videos_spec.rb
require 'spec_helper'
describe '動画に関する API' do
describe "GET /api/videos.json" do
before do
@video1 = FactoryGirl.create(:brand, name: 'すぐにまたがる家庭教師')
@video2 = FactoryGirl.create(:brand, name: '夫のために身体を差し出す人妻')
get "/api/videos.json"
end
it '200 OK が返ってくる' do
expect(response).to be_success
expect(response.status).to eq(200)
end
it '動画一覧を取得できる', autodoc: true do
expect(response.body).to match(/すぐにまたがる家庭教師/)
expect(response.body).to match(/夫のために身体を差し出す人妻/)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment