mirror of
https://github.com/discourse/discourse.git
synced 2026-08-11 05:25:16 -05:00
FIX: cannot show email for pending/inactive users
This commit is contained in:
@@ -521,7 +521,7 @@ describe UsersController do
|
||||
xhr :post, :create, create_params
|
||||
json = JSON::parse(response.body)
|
||||
json["success"].should_not == true
|
||||
|
||||
|
||||
# should not change the session
|
||||
session["user_created_email"].should be_blank
|
||||
end
|
||||
@@ -1411,6 +1411,16 @@ describe UsersController do
|
||||
json["associated_accounts"].should be_present
|
||||
end
|
||||
|
||||
it "works on inactive users" do
|
||||
inactive_user = Fabricate(:user, active: false)
|
||||
Guardian.any_instance.expects(:can_check_emails?).returns(true)
|
||||
xhr :put, :check_emails, username: inactive_user.username
|
||||
response.should be_success
|
||||
json = JSON.parse(response.body)
|
||||
json["email"].should be_present
|
||||
json["associated_accounts"].should be_present
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user