[rspec-users] How do I mock params?

Chris Olsen lists at ruby-forum.com
Fri Dec 14 01:36:56 EST 2007

Here is the code within the controller:
Line 69:   @photo = @member.build_photo(params[:photo]) unless

I got a little ahead of myself and wrote the code, and now have a bunch
of errors telling me that:
NoMethodError in 'Spec::Rails::Example::ControllerExampleGroup
MembersController handling PUT /members/1 should find the member
You have a nil object when you didn't expect it!
You might have expected an instance of ActiveRecord::Base.
The error occurred while evaluating nil.[]

I have read how to set the flash and session vars, but I haven't found
anything on the params.

Thanks for the help

BTW.  Has anyone heard if the pragmatic rspec book is still planned to
be released this month?
Posted via http://www.ruby-forum.com/.

More information about the rspec-users mailing list