Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
1ff92ed6
Commit
1ff92ed6
authored
Aug 09, 2016
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'duduribeiro/gitlab-ce-current_password_when_auto_set'
See merge request !5712.
parents
dab5e045
ed63ead2
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
0 deletions
+47
-0
CHANGELOG
CHANGELOG
+1
-0
app/controllers/profiles/passwords_controller.rb
app/controllers/profiles/passwords_controller.rb
+1
-0
spec/features/profiles/password_spec.rb
spec/features/profiles/password_spec.rb
+45
-0
No files found.
CHANGELOG
View file @
1ff92ed6
...
...
@@ -81,6 +81,7 @@ v 8.11.0 (unreleased)
- Add unfold links for Side-by-Side view. !5415 (Tim Masliuchenko)
- Adds support for pending invitation project members importing projects
- Update devise initializer to turn on changed password notification emails. !5648 (tombell)
- Avoid to show the original password field when password is automatically set. !5712 (duduribeiro)
v 8.10.5 (unreleased)
...
...
app/controllers/profiles/passwords_controller.rb
View file @
1ff92ed6
...
...
@@ -50,6 +50,7 @@ class Profiles::PasswordsController < Profiles::ApplicationController
flash
[
:notice
]
=
"Password was successfully updated. Please login with it"
redirect_to
new_user_session_path
else
@user
.
reload
render
'edit'
end
end
...
...
spec/features/profiles/password_spec.rb
0 → 100644
View file @
1ff92ed6
require
'spec_helper'
describe
'Profile > Password'
,
feature:
true
do
let
(
:user
)
{
create
(
:user
,
password_automatically_set:
true
)
}
before
do
login_as
(
user
)
visit
edit_profile_password_path
end
def
fill_passwords
(
password
,
confirmation
)
fill_in
'New password'
,
with:
password
fill_in
'Password confirmation'
,
with:
confirmation
click_button
'Save password'
end
context
'User with password automatically set'
do
describe
'User puts different passwords in the field and in the confirmation'
do
it
'shows an error message'
do
fill_passwords
(
'mypassword'
,
'mypassword2'
)
page
.
within
(
'.alert-danger'
)
do
expect
(
page
).
to
have_content
(
"Password confirmation doesn't match Password"
)
end
end
it
'does not contains the current password field after an error'
do
fill_passwords
(
'mypassword'
,
'mypassword2'
)
expect
(
page
).
to
have_no_field
(
'user[current_password]'
)
end
end
describe
'User puts the same passwords in the field and in the confirmation'
do
it
'shows a success message'
do
fill_passwords
(
'mypassword'
,
'mypassword'
)
page
.
within
(
'.flash-notice'
)
do
expect
(
page
).
to
have_content
(
'Password was successfully updated. Please login with it'
)
end
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment