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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
f8593b21
Commit
f8593b21
authored
Apr 16, 2020
by
Lee Tickett
Committed by
James Lopez
Apr 16, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix error removing secondary email
parent
d08508b9
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
2 deletions
+21
-2
app/services/emails/destroy_service.rb
app/services/emails/destroy_service.rb
+1
-1
changelogs/unreleased/fix_error_removing_secondary_email.yml
changelogs/unreleased/fix_error_removing_secondary_email.yml
+5
-0
spec/controllers/admin/users_controller_spec.rb
spec/controllers/admin/users_controller_spec.rb
+11
-0
spec/services/emails/destroy_service_spec.rb
spec/services/emails/destroy_service_spec.rb
+4
-1
No files found.
app/services/emails/destroy_service.rb
View file @
f8593b21
...
@@ -13,7 +13,7 @@ module Emails
...
@@ -13,7 +13,7 @@ module Emails
user
.
update_secondary_emails!
user
.
update_secondary_emails!
end
end
result
[
:status
]
==
'success'
result
[
:status
]
==
:success
end
end
end
end
end
end
...
...
changelogs/unreleased/fix_error_removing_secondary_email.yml
0 → 100644
View file @
f8593b21
---
title
:
Fix error removing secondary email
merge_request
:
28267
author
:
Lee Tickett
type
:
fixed
spec/controllers/admin/users_controller_spec.rb
View file @
f8593b21
...
@@ -340,6 +340,17 @@ describe Admin::UsersController do
...
@@ -340,6 +340,17 @@ describe Admin::UsersController do
end
end
end
end
describe
"DELETE #remove_email"
do
it
'deletes the email'
do
email
=
create
(
:email
,
user:
user
)
delete
:remove_email
,
params:
{
id:
user
.
username
,
email_id:
email
.
id
}
expect
(
user
.
reload
.
emails
).
not_to
include
(
email
)
expect
(
flash
[
:notice
]).
to
eq
(
'Successfully removed email.'
)
end
end
describe
"POST impersonate"
do
describe
"POST impersonate"
do
context
"when the user is blocked"
do
context
"when the user is blocked"
do
before
do
before
do
...
...
spec/services/emails/destroy_service_spec.rb
View file @
f8593b21
...
@@ -10,7 +10,10 @@ describe Emails::DestroyService do
...
@@ -10,7 +10,10 @@ describe Emails::DestroyService do
describe
'#execute'
do
describe
'#execute'
do
it
'removes an email'
do
it
'removes an email'
do
expect
{
service
.
execute
(
email
)
}.
to
change
{
user
.
emails
.
count
}.
by
(
-
1
)
response
=
service
.
execute
(
email
)
expect
(
user
.
emails
).
not_to
include
(
email
)
expect
(
response
).
to
be
true
end
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