smountcastle (3) [Avatar] Offline
#1
TL;DR My mistake, I was used to only committing once everything was working and didn't read far enough ahead.

The code introduced in Section 8.3.3 which modifies the before_filter on the ProjectsController to include the index action breaks the signing_up.feature.

If ProjectsController looks like this:

before_filter :authenticate_user!, :only => [:show] # [:index, :show]

the signing_up.feature scenario passes:

$ bin/cucumber features/signing_up.feature
Using the default profile...
Feature: Signing up
In order to be attributed for my work
As a user
I want to be able to sign up

Scenario: Signing up # features/signing_up.feature:6
Given I am on the homepage # features/step_definitions/web_steps.rb:44
When I follow "Sign up" # features/step_definitions/web_steps.rb:56
And I fill in "Email" with "user@ticketee.com" # features/step_definitions/web_steps.rb:60
And I fill in "Password" with "password" # features/step_definitions/web_steps.rb:60
And I fill in "Password confirmation" with "password" # features/step_definitions/web_steps.rb:60
And I press "Sign up" # features/step_definitions/web_steps.rb:52
Then I should see "You have signed up successfully." # features/step_definitions/web_steps.rb:105

1 scenario (1 passed)
7 steps (7 passed)

As soon as I change it to this:

before_filter :authenticate_user!, :only => [:index, :show]

the scenario fails:

$ bin/cucumber features/signing_up.feature
Using the default profile...
Feature: Signing up
In order to be attributed for my work
As a user
I want to be able to sign up

Scenario: Signing up # features/signing_up.feature:6
Given I am on the homepage # features/step_definitions/web_steps.rb:44
When I follow "Sign up" # features/step_definitions/web_steps.rb:56
And I fill in "Email" with "user@ticketee.com" # features/step_definitions/web_steps.rb:60
And I fill in "Password" with "password" # features/step_definitions/web_steps.rb:60
And I fill in "Password confirmation" with "password" # features/step_definitions/web_steps.rb:60
And I press "Sign up" # features/step_definitions/web_steps.rb:52
Then I should see "You have signed up successfully." # features/step_definitions/web_steps.rb:105
expected there to be content "You have signed up successfully." in "
Ticketee

Ticketee

You need to sign in or sign up before continuing.


Sign up
Sign in

Sign in


Email

Password

Remember me




Sign upForgot your password?Didn't receive confirmation instructions?" (RSpec::Expectations::ExpectationNotMetError)
./features/step_definitions/web_steps.rb:107:in `/^(?smilieI )should see "([^"]*)"$/'
features/signing_up.feature:13:in `Then I should see "You have signed up successfully."'

Failing Scenarios:
cucumber features/signing_up.feature:6 # Scenario: Signing up

1 scenario (1 failed)
7 steps (1 failed, 6 passed)

I tried reproducing this via the browser but it works differently since that fails when trying to render the confirmation email.
smountcastle (3) [Avatar] Offline
#2
Re: Chapter 8, Section 8.3.3 Breaks signing_up.feature
Doh! Nevermind, I see the problem.
ryanbigg (423) [Avatar] Offline
#3
Re: Chapter 8, Section 8.3.3 Breaks signing_up.feature
Glad to see you got it solved. Thanks for reading! smilie