Fix possible race conditions when suspending/unsuspending accounts (#22363)
* Fix possible race conditions when suspending/unsuspending accounts * Fix tests Tests were assuming SuspensionWorker and UnsuspensionWorker would do the suspending/unsuspending themselves, but this has changed.
This commit is contained in:
parent
8683a082dd
commit
18fb01ef7c
4 changed files with 18 additions and 19 deletions
|
@ -13,6 +13,8 @@ RSpec.describe SuspendAccountService, type: :service do
|
|||
|
||||
local_follower.follow!(account)
|
||||
list.accounts << account
|
||||
|
||||
account.suspend!
|
||||
end
|
||||
|
||||
it "unmerges from local followers' feeds" do
|
||||
|
@ -21,8 +23,8 @@ RSpec.describe SuspendAccountService, type: :service do
|
|||
expect(FeedManager.instance).to have_received(:unmerge_from_list).with(account, list)
|
||||
end
|
||||
|
||||
it 'marks account as suspended' do
|
||||
expect { subject }.to change { account.suspended? }.from(false).to(true)
|
||||
it 'does not change the “suspended” flag' do
|
||||
expect { subject }.to_not change { account.suspended? }
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue