mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 23:01:10 +08:00
FIX: revoke any api keys when suspending an user
This commit is contained in:
@ -121,6 +121,17 @@ describe Admin::UsersController do
|
||||
|
||||
end
|
||||
|
||||
context '.suspend' do
|
||||
|
||||
let(:evil_trout) { Fabricate(:evil_trout) }
|
||||
|
||||
it "also revoke any api keys" do
|
||||
User.any_instance.expects(:revoke_api_key)
|
||||
xhr :put, :suspend, user_id: evil_trout.id
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
context '.revoke_admin' do
|
||||
before do
|
||||
@another_admin = Fabricate(:admin)
|
||||
@ -501,7 +512,6 @@ describe Admin::UsersController do
|
||||
user = DiscourseSingleSignOn.parse(sso.payload)
|
||||
.lookup_or_create_user
|
||||
|
||||
|
||||
sso.name = "Bill"
|
||||
sso.username = "Hokli$$!!"
|
||||
sso.email = "bob2@bob.com"
|
||||
|
Reference in New Issue
Block a user