Hi Glenn, thanks for the response.
> I would do something like this:
>
> user = mock_model(User, :operator => true)
> controller.stub!(:current_user).and_return(user)
OK, so, :operator is not a User attribute. Rather, a user is an
operator, so to speak, if a habtm relationship exists between the user
and the role titled 'operator'. If I modify your code like this:
role = mock_model(Role, :title => 'operator')
user = mock_model(User, :roles => [role])
controller.stub!(:current_user).and_return(user)
things appear to be working well.
Thank you again for your help!
Giuseppe
--
Posted via http://www.ruby-forum.com/.
_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users