Commit deb301dd authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre

Merge branch...

Merge branch '26327-include-whether-an-email-is-verified-in-the-user-emails-api-endpoint-result' into 'master'

Return email confirmation time from email entity

See merge request gitlab-org/gitlab!58957
parents 0e619e01 e295483f
---
title: Return email confirmation time from email entity
merge_request: 58957
author:
type: changed
......@@ -1213,11 +1213,13 @@ GET /user/emails
[
{
"id": 1,
"email": "email@example.com"
"email": "email@example.com",
"confirmed_at" : "2021-03-26T19:07:56.248Z"
},
{
"id": 3,
"email": "email2@example.com"
"email": "email2@example.com",
"confirmed_at" : null
}
]
```
......@@ -1257,7 +1259,8 @@ Parameters:
```json
{
"id": 1,
"email": "email@example.com"
"email": "email@example.com",
"confirmed_at" : "2021-03-26T19:07:56.248Z"
}
```
......@@ -1276,7 +1279,8 @@ Parameters:
```json
{
"id": 4,
"email": "email@example.com"
"email": "email@example.com",
"confirmed_at" : "2021-03-26T19:07:56.248Z"
}
```
......
......@@ -3,7 +3,7 @@
module API
module Entities
class Email < Grape::Entity
expose :id, :email
expose :id, :email, :confirmed_at
end
end
end
......@@ -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_at']).to be_nil
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_at']).not_to be_nil
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment