[rspec-users] Testing arbitrary post action parameters

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


James Byrne wrote:

> 
> When /user named "(.*)" enables the administrator role/ do |name|
> 
>  put users_url( :user => User.find_by_username!(name) ), :user => 
> {:administrator => true}
> 
> end
> 
> Which at least does not blow up on me.  But it does not set the 
> administrator flag to true either.

Arrrgh... I seem to anticipated this type of thing:


#user.rb
class User < ActiveRecord::Base
...
  def administrator=(setting=false)
  end
...


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


More information about the rspec-users mailing list