Я пытаюсь создать тест с огурцом для Devise. Это моя особенность
Feature: Login to locomotive
In order to login to locomotive
As a user
I want to be able to use Locomotive
Scenario: Login to locomotive
Given I am a authenticated user
Then I should see "logged in as <email>"
Then show me the page
и это мои шаги пользователя
Given /^I am not authenticated$/ do
visit('/users/sign_out') # ensure that at least
end
Given /^I have one\s+user "([^\"]*)" with password "([^\"]*)" and username "([^\"]*)"$/ do |email, password, username|
@user = User.new(:email => email,
:username => username,
:first_name => 'Josh',
:last_name => 'Crowder',
:password => password,
:password_confirmation => password).save!
end
Given /^I am a authenticated user$/ do
email = 'testing@man.net'
username = 'josh'
password = 'secretpass'
Given %{I have one user "#{email}" with password "#{password}" and username "#{username}"}
And %{I go to login}
And %{I fill in "user_login" with "#{email}"}
And %{I fill in "user_password" with "#{password}"}
And %{I press "Sign in"}
end
Я получаю это сообщение об ошибке
F--
(::) failed steps (::)
redirected more than 5 times, check for infinite redirects. (Capybara::InfiniteRedirectError)
./features/step_definitions/web_steps.rb:29:in `block (2 levels) in <top (required)>'
./features/step_definitions/web_steps.rb:14:in `with_scope'
./features/step_definitions/web_steps.rb:28:in `/^(?:|I )press "([^"]*)"(?: within "([^"]*)")?$/'
features/user_authentication.feature:7:in `Given I am a authenticated user'
Failing Scenarios:
cucumber features/user_authentication.feature:6 # Scenario: Login to locomotive
1 scenario (1 failed)
3 steps (1 failed, 2 skipped)
Понятия не имею, почему это происходит, есть идеи?