search for: mock_awarding_body

Displaying 2 results from an estimated 2 matches for "mock_awarding_body".

2008 Oct 09
1
About received unexpected message :code with (no args)
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) end After i execute the example, below error occurs: Mock ''AwardingBody_1193'' received unexpected messa...
2008 Oct 09
1
When i use rspec(with built-in mock framework) ,errof occurs
I use rspec_scaffold generate a example 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 == (mock_awarding_body) end after execute the example , a error occurs as below : Mock ''Class'' expected :new with ({:these=&gt...