Commit 89d9319a791fd49dea734414bdbfe840816fb14c
1 parent
f8e27b92
Exists in
master
and in
4 other branches
Fix rendered action for password change failure
Closes #1912
Showing
3 changed files
with
16 additions
and
1 deletions
Show diff stats
app/controllers/profile_controller.rb
features/profile/profile.feature
| ... | ... | @@ -16,6 +16,11 @@ Feature: Profile |
| 16 | 16 | Then I change my password |
| 17 | 17 | And I should be redirected to sign in page |
| 18 | 18 | |
| 19 | + Scenario: I unsuccessfully change my password | |
| 20 | + Given I visit profile account page | |
| 21 | + When I unsuccessfully change my password | |
| 22 | + Then I should see a password error message | |
| 23 | + | |
| 19 | 24 | Scenario: I reset my token |
| 20 | 25 | Given I visit profile account page |
| 21 | 26 | Then I reset my token | ... | ... |
features/steps/profile/profile.rb
| ... | ... | @@ -28,6 +28,16 @@ class Profile < Spinach::FeatureSteps |
| 28 | 28 | click_button "Save" |
| 29 | 29 | end |
| 30 | 30 | |
| 31 | + When 'I unsuccessfully change my password' do | |
| 32 | + fill_in "user_password", with: "password" | |
| 33 | + fill_in "user_password_confirmation", with: "confirmation" | |
| 34 | + click_button "Save" | |
| 35 | + end | |
| 36 | + | |
| 37 | + Then "I should see a password error message" do | |
| 38 | + page.should have_content "Password doesn't match confirmation" | |
| 39 | + end | |
| 40 | + | |
| 31 | 41 | And 'I should be redirected to sign in page' do |
| 32 | 42 | current_path.should == new_user_session_path |
| 33 | 43 | end | ... | ... |