Commit c30a8f26 authored by Serena Fang's avatar Serena Fang

Add confirmed to email entity

parent 4371aec5
......@@ -3,7 +3,7 @@
module API
module Entities
class Email < Grape::Entity
expose :id, :email
expose :id, :email, :confirmed?
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?']).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
......
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