Skip to content

Instantly share code, notes, and snippets.

@jvanbaarsen
Created February 13, 2015 14:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jvanbaarsen/414f4dd57e15f3624bb1 to your computer and use it in GitHub Desktop.
Save jvanbaarsen/414f4dd57e15f3624bb1 to your computer and use it in GitHub Desktop.
Failing spinach step
require Rails.root.join('spec', 'support', 'login_helpers')
module SharedAuthentication
include Spinach::DSL
include LoginHelpers
step 'I sign in as a user' do
login_as :user
end
step 'I sign in as an admin' do
login_as :admin
end
step 'I sign in as "John Doe"' do
login_with(user_exists("John Doe"))
end
step 'I sign in as "Mary Jane"' do
login_with(user_exists("Mary Jane"))
end
step 'I should be redirected to sign in page' do
current_path.should == new_user_session_path
end
step "I logout" do
logout
end
def current_user
@user || User.first
end
end
Scenario: I change my password
✔ Given I sign in as a user # features/steps/shared/authentication.rb:7
✔ Given I visit profile password page # features/steps/shared/paths.rb:102
✔ Then I change my password # features/steps/profile/profile.rb:68
✘ And I should be redirected to sign in page # features/steps/shared/authentication.rb:23
expected: "/users/sign_in"
got: "/profile/password/edit" (using ==)
/Users/jeroen/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/rspec-expectations-3.2.0/lib/rspec/expectations/fail_with.rb:29:in `fail_with'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment