Cappibara BDD Cucumber and Integration

As a follow-up to my previous question about SO , I went through the tutorial at https://github.com/RailsApps/rails3-devise-rspec-cucumber/wiki/Tutorial to try to pinpoint the origin of my failed tests.

My main script fails:

Feature: Sign in Scenario: User signs in successfully with email Given I am a new, authenticated user When I go to the tour page Then I should be signed in 

These are my steps:

 Given /^I have one\s+user "([^\"]*)" with password "([^\"]*)"$/ do |email, password| u = User.new(:email => email, :password => password, :password_confirmation => password) u.skip_confirmation! u.save! end Given /^I am a new, authenticated user$/ do email = ' user@test.com ' password = 'please' Given %{I have one user "#{email}" with password "#{password}"} And %{I go to the sign in page} And %{I fill in "user_email" with "#{email}"} And %{I fill in "user_password" with "#{password}"} And %{I press "Log Me In"} end Then /^I should be signed in$/ do And %{I should see "Sign out"} end 

Login error even if my test user is created correctly. Using save_and_open_page shows that capybara fills out the form as expected, so this seems like a difficult problem.

I am wondering if there is a problem with integration with components, since I use the rails 3.0 setting (the tutorial applies to version 3.1).

My environment uses the following:

  • ruby 1.8.7
  • rails 3.0.3
  • capybara 1.0.0
  • cucumber 1.0.0
  • devise 1.2.rc
  • rake 0.9.2
+4
source share

Source: https://habr.com/ru/post/891284/


All Articles