Created
August 23, 2012 17:54
-
-
Save arturaz/3439443 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 "planets|player_index" do | |
before(:each) do | |
@action = "planets|player_index" | |
@params = {} | |
end | |
it_behaves_like "only push" | |
it_should_behave_like "having controller action scope" | |
it "should return players planets" do | |
planet0 = Factory.create :planet_with_player | |
planet1 = Factory.create :planet_with_player, | |
:player => player | |
planet2 = Factory.create :planet_with_player, | |
:player => player | |
planet3 = Factory.create :planet_with_player | |
push @action, @params | |
# Try to account for time difference | |
[planet1, planet2].each_with_index do |planet, index| | |
planet.reload | |
response[:planets][index].should equal_to_hash( | |
planet.as_json(:index => true, :view => true)) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment