[rspec-users] Specing based on user roles
lists at ruby-forum.com
Tue Nov 11 17:39:07 EST 2008
Nick Hoffman wrote:
> On 2008-11-11, at 17:24, Fernando Perez wrote:
>>> describe OrdersController do
>>> for_roles :admin, :sysadmin do |role|
>> look like? And where do you put this code? I am not sure mine (if
>> working) gets initialized correctly.
>> I think I have to write my specs from scratch.
> Hi Fernando. #login_as is a custom method that you need to write
> yourself. It should simply login as the given user, or a user with the
> given role. Its implementation will depend on which authentication and
> authorisation system you're using.
I am using restful_authentication. I tried to look at their specs, but
they are unreadable. So I am trying to throw together my own
authentication mocker/stuber but with no luck.
Posted via http://www.ruby-forum.com/.
More information about the rspec-users