Created
November 23, 2011 21:17
-
-
Save koos/1389943 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe PeopleController do | |
shared_examples 'successful response' do | |
it 'should be successful' do | |
response.should be_success | |
end | |
it 'should respond in JSON format' do | |
response.content_type.should == 'application/json' | |
end | |
end | |
[...] | |
describe 'GET /people/:id (#show)' do | |
before :each do | |
get :show, :id => Person.first, :format => :json | |
end | |
it_should_behave_like 'successful response' | |
it 'should have your custom behaviour...' do | |
# foo | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment