mirror of
https://github.com/discourse/discourse.git
synced 2025-06-04 23:36:11 +08:00
FEATURE: Secondary emails support.
This commit is contained in:

committed by
Guo Xiang Tan

parent
50e59fb9bd
commit
21ebb1cd54
@ -1900,14 +1900,16 @@ describe UsersController do
|
||||
expect(response).to be_forbidden
|
||||
end
|
||||
|
||||
it "returns both email and associated_accounts when you're allowed to see them" do
|
||||
it "returns emails and associated_accounts when you're allowed to see them" do
|
||||
user = Fabricate(:user)
|
||||
sign_in_admin
|
||||
|
||||
get "/u/#{Fabricate(:user).username}/emails.json"
|
||||
get "/u/#{user.username}/emails.json"
|
||||
|
||||
expect(response.status).to eq(200)
|
||||
json = JSON.parse(response.body)
|
||||
expect(json["email"]).to be_present
|
||||
expect(json["email"]).to eq(user.email)
|
||||
expect(json["secondary_emails"]).to eq(user.secondary_emails)
|
||||
expect(json["associated_accounts"]).to be_present
|
||||
end
|
||||
|
||||
@ -1919,7 +1921,8 @@ describe UsersController do
|
||||
|
||||
expect(response.status).to eq(200)
|
||||
json = JSON.parse(response.body)
|
||||
expect(json["email"]).to be_present
|
||||
expect(json["email"]).to eq(inactive_user.email)
|
||||
expect(json["secondary_emails"]).to eq(inactive_user.secondary_emails)
|
||||
expect(json["associated_accounts"]).to be_present
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user