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
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
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
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