Skip to content

Commit 4f04d7d

Browse files
committed
Merge pull request gitlabhq#1915 from tsigo/issue/1912
Fix rendered action for password change failure
2 parents dd4d124 + 89d9319 commit 4f04d7d

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

app/controllers/profile_controller.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def password_update
2222
flash[:notice] = "Password was successfully updated. Please login with it"
2323
redirect_to new_user_session_path
2424
else
25-
render action: "password"
25+
render 'account'
2626
end
2727
end
2828

features/profile/profile.feature

+5
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ Feature: Profile
1616
Then I change my password
1717
And I should be redirected to sign in page
1818

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+
1924
Scenario: I reset my token
2025
Given I visit profile account page
2126
Then I reset my token

features/steps/profile/profile.rb

+10
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,16 @@ class Profile < Spinach::FeatureSteps
2828
click_button "Save"
2929
end
3030

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+
3141
And 'I should be redirected to sign in page' do
3242
current_path.should == new_user_session_path
3343
end

0 commit comments

Comments
 (0)