BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
36bc2e90
Commit
36bc2e90
authored
Jun 16, 2017
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix specs
parent
ef6a4240
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
14 deletions
+3
-14
users_controller.rb
app/controllers/admin/users_controller.rb
+3
-2
user_spec.rb
spec/models/user_spec.rb
+0
-12
No files found.
app/controllers/admin/users_controller.rb
View file @
36bc2e90
...
@@ -158,15 +158,16 @@ class Admin::UsersController < Admin::ApplicationController
...
@@ -158,15 +158,16 @@ class Admin::UsersController < Admin::ApplicationController
user
.
update_secondary_emails!
user
.
update_secondary_emails!
end
end
respond_to
do
|
format
|
if
result
[
:status
]
==
:success
if
result
[
:status
]
==
:success
format
.
html
{
redirect_back_or_admin_user
(
notice:
"Successfully removed email."
)
}
format
.
html
{
redirect_back_or_admin_user
(
notice:
"Successfully removed email."
)
}
format
.
json
{
head
:ok
}
format
.
json
{
head
:ok
}
else
else
# restore username to keep form action url.
format
.
html
{
redirect_back_or_admin_user
(
alert:
result
[
:message
])
}
format
.
html
{
redirect_back_or_admin_user
(
notice:
result
[
:message
])
}
format
.
json
{
render
json:
result
[
:message
],
status:
result
[
:status
]
}
format
.
json
{
render
json:
result
[
:message
],
status:
result
[
:status
]
}
end
end
end
end
end
protected
protected
...
...
spec/models/user_spec.rb
View file @
36bc2e90
...
@@ -1899,16 +1899,4 @@ describe User, models: true do
...
@@ -1899,16 +1899,4 @@ describe User, models: true do
user
.
invalidate_merge_request_cache_counts
user
.
invalidate_merge_request_cache_counts
end
end
end
end
describe
'audit changes'
do
let!
(
:user
)
{
create
(
:user
)
}
it
'audits an email change'
do
expect
{
user
.
update!
(
email:
'test@example.com'
)
}.
to
change
{
AuditEvent
.
count
}.
by
(
1
)
end
it
'audits a password change'
do
expect
{
user
.
update!
(
password:
'asdfasdf'
,
password_confirmation:
'asdfasdf'
)
}.
to
change
{
AuditEvent
.
count
}.
by
(
1
)
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