Re: [rspec-users] how to mock/stub restful_authenticated and acl2-ized actions

2008-04-08 Thread Chris Flipse
On Tue, Apr 8, 2008 at 10:03 AM, Giuseppe Bertini <[EMAIL PROTECTED]> wrote: > Dear all, > > I am wondering how to properly mock/stub out the preliminary steps to > actions protected by restful_authentication and acl_system2 (role-based > authorization to execute actions). Here's my setup: > I us

Re: [rspec-users] how to mock/stub restful_authenticated and acl2-ized actions

2008-04-08 Thread Glenn Ford
While my approach might not be the best, since I don't stub :login_required, it still serves me well. I would do something like this: user = mock_model(User, :operator => true) controller.stub!(:current_user).and_return(user) login_required will find the 'current_user' and be happy. I don't

[rspec-users] how to mock/stub restful_authenticated and acl2-ized actions

2008-04-08 Thread Giuseppe Bertini
Dear all, I am wondering how to properly mock/stub out the preliminary steps to actions protected by restful_authentication and acl_system2 (role-based authorization to execute actions). Here's my setup: class User < ActiveRecord::Base has_and_belongs_to_many :roles has_many :tasks [snip] e