Re: [rspec-users] Help with global before behavior...

2009-05-08 Thread David Chelimsky
On Fri, May 8, 2009 at 1:51 PM, Denis Haskin wrote: > Okay, I guess I can do this with shared examples.  I added to my > spec_helper.rb: > > describe "an admin user is signed in", :shared => true do >  before( :each ) do >   @admin_user = Factory(:admin_user) >   login_as @admin_user >  end > end

Re: [rspec-users] Help with global before behavior...

2009-05-08 Thread Scott Taylor
Denis Haskin wrote: I'm having a devil of a time getting some global before behavior to work the way I think it should. I have a set of controllers that are used only by administrative users, so login is required. To run examples just against the functionality, ideally I'd like to be able to

Re: [rspec-users] Help with global before behavior...

2009-05-08 Thread Denis Haskin
Okay, I guess I can do this with shared examples. I added to my spec_helper.rb: describe "an admin user is signed in", :shared => true do before( :each ) do @admin_user = Factory(:admin_user) login_as @admin_user end end and then in each controller that needs that behavior: it_should

[rspec-users] Help with global before behavior...

2009-05-08 Thread Denis Haskin
I'm having a devil of a time getting some global before behavior to work the way I think it should. I have a set of controllers that are used only by administrative users, so login is required. To run examples just against the functionality, ideally I'd like to be able to set up a before() th