[rspec-users] About received unexpected message :code with (no args)

Guofeng Ma lists at ruby-forum.com
Thu Oct 9 05:40:18 EDT 2008

I use rspec_scaffold to generate a part of examples as below:

it "should expose a newly created awarding_body as @awarding_body" do
        AwardingBody.should_receive(:new).with({'these' =>
'params'}).and_return(mock_awarding_body(:save => true))
        post :create, :awarding_body => {:these => 'params'}
        assigns(:awarding_body).should equal(mock_awarding_body)

After i execute the example, below error occurs:

Mock 'AwardingBody_1193' received unexpected message :code with (no

how to deal with it?
Posted via http://www.ruby-forum.com/.

More information about the rspec-users mailing list