try: it "should find the item requested" do
@current_company.items.should_receive(:find).with("1").and_return(@item)
do_get
end
-Matt
___
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users
you no longer have @players
try
assigns[:players].should eql(@game.players)
On 10/8/07, Andrew WC Brown <[EMAIL PROTECTED]> wrote:
> Here's my old association:
>
> @game = mock_game(:to_param => "1")
> Game.stub!(:find).and_return(@game)
> @players = mock('player_proxy')
> @player
I've added a method to the mock class that makes it pretty easy to
stub associations in rails. I've been using it for awhile and it seems
to cut down on a lot of setup code for the controller and model specs
that use associations.
#before
@person = mock_model(Person)
posts = mock('post_proxy')
pos