Created
September 28, 2012 12:03
-
-
Save electronicbites/3799426 to your computer and use it in GitHub Desktop.
sample for specs for gamecontroller
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
it 'should contain a collection of games' do | |
game1 = FactoryGirl.create(:game, titel: 'foo1') | |
game2 = FactoryGirl.create(:game, titel: 'foo2') | |
get :index | |
json = ActiveSupport::JSON.decode(response.body) | |
json[:game].size == 2 | |
end | |
it 'should contain the title of the game' do | |
game = FactoryGirl.create(:game, titel: 'foo1') | |
get :index | |
json = ActiveSupport::JSON.decode(response.body) | |
json[:game].first[:title].should == 'foo1' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment