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
c30a8f26
Commit
c30a8f26
authored
Apr 08, 2021
by
Serena Fang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add confirmed to email entity
parent
4371aec5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
5 deletions
+3
-5
lib/api/entities/email.rb
lib/api/entities/email.rb
+1
-1
spec/requests/api/users_spec.rb
spec/requests/api/users_spec.rb
+2
-4
No files found.
lib/api/entities/email.rb
View file @
c30a8f26
...
...
@@ -3,7 +3,7 @@
module
API
module
Entities
class
Email
<
Grape
::
Entity
expose
:id
,
:email
expose
:id
,
:email
,
:confirmed?
end
end
end
spec/requests/api/users_spec.rb
View file @
c30a8f26
...
...
@@ -1795,8 +1795,7 @@ RSpec.describe API::Users do
post
api
(
"/users/
#{
user
.
id
}
/emails"
,
admin
),
params:
email_attrs
end
.
to
change
{
user
.
emails
.
count
}.
by
(
1
)
email
=
Email
.
find_by
(
user_id:
user
.
id
,
email:
email_attrs
[
:email
])
expect
(
email
).
not_to
be_confirmed
expect
(
json_response
[
'confirmed?'
]).
to
be_falsey
end
it
"returns a 400 for invalid ID"
do
...
...
@@ -1813,8 +1812,7 @@ RSpec.describe API::Users do
expect
(
response
).
to
have_gitlab_http_status
(
:created
)
email
=
Email
.
find_by
(
user_id:
user
.
id
,
email:
email_attrs
[
:email
])
expect
(
email
).
to
be_confirmed
expect
(
json_response
[
'confirmed?'
]).
to
be_truthy
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