I’m working my way through Hartl’s Rails Tutorial (http://ruby.railstutorial.org/chapters/sign-in-sign-out#sec:cucumber).
I finished through chapter 9 and then decided to go back and do the optional Cucumber part in Chapter 8.3.
I added cucumber-rails and database_cleaner to the Gemfile:
group :test do
gem 'capybara', '1.1.2'
gem 'rb-fsevent', '0.4.3.1', :require = false
gem 'growl', '1.0.3'
gem 'factory_girl_rails', '1.4.0'
gem 'cucumber-rails', '1.2.1', require: false
gem 'database_cleaner', '0.7.0'
end
In terminal, I ran these commands:
bundle install
rails generate cucumber:install
Everything seemed to install just fine. Then I added the file ‘signing_in.feature’ to the ‘features/’ directory.
Feature: Signing in
Scenario: Unsuccessful signin
Given a user visits the signin page
When he submits invalid signin information
Then he should see an error message
Scenario: Successful signin
Given a user visits the signin page
And the user has an account
And the user submits valid signin information
Then he should see his profile page
And he should see a signout link
Then I ran this:
bundle exec cucumber features/
And here was the result in terminal:
Using the default profile...
Feature: Signing in
0 scenarios
0 steps
0m0.000s
I think I’m expecting there to be 2 scenarios and 2 failures. Is there a step that I left out? Could anything I added in chapter 9 interfere with this?
Thank you.
I may have not saved one of the files. I went back and saved it, and it now works as expected.
Nothing to see here, move along. 🙂