require'rails_helper'RSpec.describeAccount,type::modeldocontextdolet(:bob){Fabricate(:account,username:'bob')}subject{Fabricate(:account)}describe'#suspend!'doit'marks the account as suspended'dosubject.suspend!expect(subject.suspended?).tobetrueendit'creates a deletion request'dosubject.suspend!expect(AccountDeletionRequest.where(account:subject).exists?).tobetrueendcontext'when the account is of a local user'dolet!(:subject){Fabricate(:user,email:'foo+bar@domain.org').account}it'creates a canonical domain block'dosubject.suspend!expect(CanonicalEmailBlock.block?(subject.user_email)).tobetrueendcontext'when a canonical domain block already exists for that email'dobeforedoFabricate(:canonical_email_block,email:subject.user_email)endit'does not raise an error'doexpect{subject.suspend!}.not_toraise_errorendendendenddescribe'#follow!'doit'creates a follow'dofollow=subject.follow!(bob)expect(follow).tobe_instance_ofFollowexpect(follow.account).toeqsubjectexpect(follow.target_account).toeqbobendenddescribe'#unfollow!'dobeforedosubject.follow!(bob)endit'destroys a follow'dounfollow=subject.unfollow!(bob)expect(unfollow).tobe_instance_ofFollowexpect(unfollow.account).toeqsubjectexpect(unfollow.target_account).toeqbobexpect(unfollow.destroyed?).tobetrueendenddescribe'#following?'doit'returns true when the target is followed'dosubject.follow!(bob)expect(subject.following?(bob)).tobetrueendit'returns false if the target is not followed'doexpect(subject.following?(bob)).tobefalseendendenddescribe'#local?'do