Combine assertions about same setup in Account#suspend!
spec (#28787)
This commit is contained in:
parent
89c9a4502d
commit
07e10e3747
1 changed files with 4 additions and 8 deletions
|
@ -9,14 +9,10 @@ RSpec.describe Account do
|
||||||
let(:bob) { Fabricate(:account, username: 'bob') }
|
let(:bob) { Fabricate(:account, username: 'bob') }
|
||||||
|
|
||||||
describe '#suspend!' do
|
describe '#suspend!' do
|
||||||
it 'marks the account as suspended' do
|
it 'marks the account as suspended and creates a deletion request' do
|
||||||
subject.suspend!
|
expect { subject.suspend! }
|
||||||
expect(subject.suspended?).to be true
|
.to change(subject, :suspended?).from(false).to(true)
|
||||||
end
|
.and(change { AccountDeletionRequest.exists?(account: subject) }.from(false).to(true))
|
||||||
|
|
||||||
it 'creates a deletion request' do
|
|
||||||
subject.suspend!
|
|
||||||
expect(AccountDeletionRequest.where(account: subject).exists?).to be true
|
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when the account is of a local user' do
|
context 'when the account is of a local user' do
|
||||||
|
|
Loading…
Reference in a new issue