Displaying 2 results from an estimated 2 matches for "salt_grains".
2007 Oct 06
4
spec''ing views, mock_model associations
...t; @game
response.should have_tag(''a'',"(2) Players")
end
I''m not sure how to do the mock model, I think it would be done two ways but
unsure of the syntax:
1: add players in
@game = mock_model(Game,
:name => ''The Battle for Blaze'',
:salt_grains => ''5000000'',
:people => ''5000000'',
:days => nil,
:created_at => "Mon Oct 01 00:02:44 -0400 2007",
:enabled => true,
:players => {
})
2: assign them to players
@game = mock_model(Game,
:name => ''The Bat...
2007 Oct 05
13
spec''ing view render partial collection, local variable not found
...0c>:0x2f1154c>
/Volumes/EXTERNAL/web/omenking.ca/vendor/plugins/rspec_on_rails/lib/spec/rails/matchers/have_text.rb:12:in
`matches?''
./spec/views/games/_game.rhtml_spec.rb:39:
def before
game = mock_model(Game,
:name => ''The Battle for Blaze'',
:salt_grains => 5000000,
:people => 5000000,
:days => nil,
:created_at => "Mon Oct 01 00:02:44 -0400 2007",
:enabled => true)
game.should_receive(:name).and_return("The Battle for Blaze")
game.should_receive(:salt_grains).and_return(5000000)...