mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
FIX: revoke any api keys when suspending an user
This commit is contained in:
parent
91519fdfe7
commit
73624e63c5
2 changed files with 12 additions and 1 deletions
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue