[rspec-users] Testing user_controller update action

Andrew Davis lists at ruby-forum.com
Thu Nov 18 14:20:59 EST 2010


To post a solution to my problem:

describe "PUT 'update'" do
    before(:each) do

      User.should_receive(:find).with(:first, 
{:conditions=>{:id=>@user.id}}).and_return(@user)
      User.should_receive(:find).with(@user).and_return(@user)
    end
    .
    .
    .

The first line is for the authentication.

-- 
Posted via http://www.ruby-forum.com/.


More information about the rspec-users mailing list