Fix RSpec/LetSetup
cop in spec/services (#28459)
This commit is contained in:
parent
efd16f3c2c
commit
9251779d75
14 changed files with 74 additions and 87 deletions
|
@ -18,12 +18,11 @@ describe Scheduler::UserCleanupScheduler do
|
|||
confirmed_user.update!(confirmed_at: 1.day.ago)
|
||||
end
|
||||
|
||||
it 'deletes the old unconfirmed user' do
|
||||
expect { subject.perform }.to change { User.exists?(old_unconfirmed_user.id) }.from(true).to(false)
|
||||
end
|
||||
|
||||
it "deletes the old unconfirmed user's account" do
|
||||
expect { subject.perform }.to change { Account.exists?(old_unconfirmed_user.account_id) }.from(true).to(false)
|
||||
it 'deletes the old unconfirmed user, their account, and the moderation note' do
|
||||
expect { subject.perform }
|
||||
.to change { User.exists?(old_unconfirmed_user.id) }.from(true).to(false)
|
||||
.and change { Account.exists?(old_unconfirmed_user.account_id) }.from(true).to(false)
|
||||
expect { moderation_note.reload }.to raise_error(ActiveRecord::RecordNotFound)
|
||||
end
|
||||
|
||||
it 'does not delete the new unconfirmed user or their account' do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue