Я изменил это на следующее:
Scenario: Login
Given a user exists with email: "fred@example.com", plain_password: "password", plain_password_confirmation: "password"
And I am on the home page
When I login with "fred@example.com", "password"
And I submit the form
Then I should see "Welcome"
Со следующими определениями шагов:
When(/^I login with "(\S+)", "(.*)"$/) do |email, password|
fill_in 'username', :with => email
fill_in 'plain_password', :with => password
end
# Can only be executed with Selenium or Envjs drivers
When /^I submit the form$/ do
page.evaluate_script("document.forms[0].submit()")
end
И это работает!