Re: [rspec-users] Testing user_controller update action

2010-11-18 Thread Andrew Davis
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 au

Re: [rspec-users] Testing user_controller update action

2010-11-18 Thread Andrew Davis
Okay... Problem temporarily solved. Turns out it has to do with my before filter. I have: before_filter :authenticate_user! before_filter :set_conditions in the application controller. And: before_filter :authorize At the top of the users_controller. For some reason it works with those comme

[rspec-users] Testing user_controller update action

2010-11-18 Thread Andrew Davis
Hello everyone, I'm trying to test the update action in my user controller, but unfortunately having troubles. You can find all of my code and relevant code here: http://pastie.org/private/odzbqvcoe8kdnh97ocaxia You can find the exact RSpec error here: http://pastie.org/private/pnpr3dgst1m50ixt4j