[rspec-users] Testing arbitrary post action parameters

James Byrne lists at ruby-forum.com
Sat Jan 17 18:34:54 EST 2009

James Byrne wrote:

> I have spent a good deal of time trying to get this to work with no 
> success.  I have read the api regarding the put method in:
>  ActionController::Integration::Session
> If I read this aright then in your example user should be a hash, but a 
> hash of what? Where would I create it in my test and what should it 
> contain?

I ended up with this:

 :user => User.find(:first)

When /user named "(.*)" enables the administrator role/ do |name|

 put users_url( :user => User.find_by_username!(name) ), :user => 
{:administrator => true}


Which at least does not blow up on me.  But it does not set the 
administrator flag to true either.

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

More information about the rspec-users mailing list