How do I mock params?

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

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
requested’
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.[]
/Users/chris/Documents/Projects/Rails/CommunityCMS/trunk/app/controllers/members_controller.rb:69:in
update' /Users/chris/Documents/Projects/Rails/CommunityCMS/trunk/vendor/rails/actionpack/lib/action_controller/base.rb:1168:insend’

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?

Ya, just ignore this post, except for the question regarding the rpsec
book.

I really do wish there was a way to delete your own posts :slight_smile:

On 14 Dec 2007, at 06:36, Chris O. wrote:

BTW. Has anyone heard if the pragmatic rspec book is still planned to
be released this month?

I second this – O’Reilly owe me a book for the November hackfest and
I’m wondering whether I should ask for a rain check until the RSpec
tome arrives.

Come on guys, it’s Christmas! :slight_smile:

Cheers,
-Tom

I want to see a TOC.

On Dec 14, 2007 2:35 AM, Tom S. [email protected] wrote:

On 14 Dec 2007, at 06:36, Chris O. wrote:

BTW. Has anyone heard if the pragmatic rspec book is still planned to
be released this month?

I second this – O’Reilly owe me a book for the November hackfest and
I’m wondering whether I should ask for a rain check until the RSpec
tome arrives.

Come on guys, it’s Christmas! :slight_smile:

We’re aiming for beta in January. So far our aim hasn’t been that
great :). But we’re making good progress now. Expect to see some
bloggage soon.

Cheers,
David

On Dec 16, 2007 3:37 PM, Andrew WC Brown [email protected] wrote:

I want to see a TOC.

Me too :slight_smile:

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs