Commit a0a8213c4fd73e6cda401e5a12683c93802995ae
1 parent
d0b8fb41
Exists in
master
and in
1 other branch
updated features and step definitions for new clearance
Showing
3 changed files
with
12 additions
and
26 deletions
Show diff stats
features/step_definitions/clearance_steps.rb
| ... | ... | @@ -51,13 +51,14 @@ Then /^a confirmation message should be sent to "(.*)"$/ do |email| |
| 51 | 51 | sent = ActionMailer::Base.deliveries.first |
| 52 | 52 | assert_equal [user.email], sent.to |
| 53 | 53 | assert_match /confirm/i, sent.subject |
| 54 | - assert !user.token.blank? | |
| 55 | - assert_match /#{user.token}/, sent.body | |
| 54 | + assert !user.confirmation_token.blank? | |
| 55 | + assert_match /#{user.confirmation_token}/, sent.body | |
| 56 | 56 | end |
| 57 | 57 | |
| 58 | 58 | When /^I follow the confirmation link sent to "(.*)"$/ do |email| |
| 59 | 59 | user = User.find_by_email(email) |
| 60 | - visit new_user_confirmation_path(:user_id => user, :token => user.token) | |
| 60 | + visit new_user_confirmation_path(:user_id => user, | |
| 61 | + :token => user.confirmation_token) | |
| 61 | 62 | end |
| 62 | 63 | |
| 63 | 64 | Then /^a password reset message should be sent to "(.*)"$/ do |email| |
| ... | ... | @@ -65,13 +66,14 @@ Then /^a password reset message should be sent to "(.*)"$/ do |email| |
| 65 | 66 | sent = ActionMailer::Base.deliveries.first |
| 66 | 67 | assert_equal [user.email], sent.to |
| 67 | 68 | assert_match /password/i, sent.subject |
| 68 | - assert !user.token.blank? | |
| 69 | - assert_match /#{user.token}/, sent.body | |
| 69 | + assert !user.confirmation_token.blank? | |
| 70 | + assert_match /#{user.confirmation_token}/, sent.body | |
| 70 | 71 | end |
| 71 | 72 | |
| 72 | 73 | When /^I follow the password reset link sent to "(.*)"$/ do |email| |
| 73 | 74 | user = User.find_by_email(email) |
| 74 | - visit edit_user_password_path(:user_id => user, :token => user.token) | |
| 75 | + visit edit_user_password_path(:user_id => user, | |
| 76 | + :token => user.confirmation_token) | |
| 75 | 77 | end |
| 76 | 78 | |
| 77 | 79 | When /^I try to change the password of "(.*)" without token$/ do |email| |
| ... | ... | @@ -85,11 +87,10 @@ end |
| 85 | 87 | |
| 86 | 88 | # Actions |
| 87 | 89 | |
| 88 | -When /^I sign in( with "remember me")? as "(.*)\/(.*)"$/ do |remember, email, password| | |
| 90 | +When /^I sign in as "(.*)\/(.*)"$/ do |email, password| | |
| 89 | 91 | When %{I go to the sign in page} |
| 90 | 92 | And %{I fill in "Email" with "#{email}"} |
| 91 | 93 | And %{I fill in "Password" with "#{password}"} |
| 92 | - And %{I check "Remember me"} if remember | |
| 93 | 94 | And %{I press "Sign In"} |
| 94 | 95 | end |
| 95 | 96 | |
| ... | ... | @@ -99,13 +100,13 @@ end |
| 99 | 100 | |
| 100 | 101 | When /^I request password reset link to be sent to "(.*)"$/ do |email| |
| 101 | 102 | When %{I go to the password reset request page} |
| 102 | - And %{I fill in "Email" with "#{email}"} | |
| 103 | + And %{I fill in "Email address" with "#{email}"} | |
| 103 | 104 | And %{I press "Reset password"} |
| 104 | 105 | end |
| 105 | 106 | |
| 106 | 107 | When /^I update my password with "(.*)\/(.*)"$/ do |password, confirmation| |
| 107 | - And %{I fill in "Password" with "#{password}"} | |
| 108 | - And %{I fill in "Password confirmation" with "#{confirmation}"} | |
| 108 | + And %{I fill in "Choose password" with "#{password}"} | |
| 109 | + And %{I fill in "Confirm password" with "#{confirmation}"} | |
| 109 | 110 | And %{I press "Save this password"} |
| 110 | 111 | end |
| 111 | 112 | ... | ... |
features/users/sign_in.feature
| ... | ... | @@ -30,13 +30,6 @@ Feature: Sign in |
| 30 | 30 | And I sign in as "email@person.com/password" |
| 31 | 31 | Then I should see "Signed in" |
| 32 | 32 | And I should be signed in |
| 33 | - | |
| 34 | - Scenario: User signs in and checks "remember me" | |
| 35 | - Given I am signed up and confirmed as "email@person.com/password" | |
| 36 | - When I go to the sign in page | |
| 37 | - And I sign in with "remember me" as "email@person.com/password" | |
| 38 | - Then I should see "Signed in" | |
| 39 | - And I should be signed in | |
| 40 | 33 | When I return next time |
| 41 | 34 | Then I should be signed in |
| 42 | 35 | ... | ... |
features/users/sign_out.feature
| ... | ... | @@ -10,14 +10,6 @@ Feature: Sign out |
| 10 | 10 | And I sign out |
| 11 | 11 | Then I should see "Signed out" |
| 12 | 12 | And I should be signed out |
| 13 | - | |
| 14 | - Scenario: User who was remembered signs out | |
| 15 | - Given I am signed up and confirmed as "email@person.com/password" | |
| 16 | - When I sign in with "remember me" as "email@person.com/password" | |
| 17 | - Then I should be signed in | |
| 18 | - And I sign out | |
| 19 | - Then I should see "Signed out" | |
| 20 | - And I should be signed out | |
| 21 | 13 | When I return next time |
| 22 | 14 | Then I should be signed out |
| 23 | 15 | ... | ... |