diff options
author | Claire <claire.github-309c@sitedethib.com> | 2023-01-05 13:47:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-05 13:47:21 +0100 |
commit | 18fb01ef7ca3829b07bb8ea101bdd073da72cfbc (patch) | |
tree | 5e493ef3997176e4a98be57ee68068d427176906 /spec/services/suspend_account_service_spec.rb | |
parent | 8683a082ddc04b2028b73a039325fd70fe3c55a9 (diff) |
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.
Diffstat (limited to 'spec/services/suspend_account_service_spec.rb')
-rw-r--r-- | spec/services/suspend_account_service_spec.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/spec/services/suspend_account_service_spec.rb b/spec/services/suspend_account_service_spec.rb index 5d45e4ffd..126b13986 100644 --- a/spec/services/suspend_account_service_spec.rb +++ b/spec/services/suspend_account_service_spec.rb @@ -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 |