Reputation: 21877
I installed Devise, and all of my cucumber tests are now failing because I require the user to login. This makes sense.
Is there a way to specify that a user is logged in WITHOUT going through a senario such as this:
> Scenario: Create Issue
> Given I am on the home page
> When I fill in "Email" with "[email protected]"
> And I fill in "Password" with "secret"
> And I press "Sign in"
> Then I am on the list of issues
I tried something like the following: user_signed_in? = true
but this fails. Help please.
Upvotes: 1
Views: 178
Reputation: 64147
As seen in this guide, you can factor out that code into multiple matchers to help reduce duplication. More specifically I'd look at the Given /^I am a new, authenticated user$/ do
block.
Upvotes: 2