Skip to content

Commit

Permalink
Add attachment check to spec/service/suspend_account_service spec (#2…
Browse files Browse the repository at this point in the history
  • Loading branch information
mjankowski committed Jan 8, 2024
1 parent 2ae53e6 commit 832b92a
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions spec/services/suspend_account_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,24 @@
list.accounts << account

account.suspend!

Fabricate(:media_attachment, file: attachment_fixture('boop.ogg'), account: account)
end

it 'unmerges from feeds of local followers and preserves suspended flag' do
it 'unmerges from feeds of local followers and changes file mode and preserves suspended flag' do
expect { subject }
.to_not change_suspended_flag
.to change_file_mode
.and not_change_suspended_flag
expect(FeedManager.instance).to have_received(:unmerge_from_home).with(account, local_follower)
expect(FeedManager.instance).to have_received(:unmerge_from_list).with(account, list)
end

def change_suspended_flag
change(account, :suspended?)
def change_file_mode
change { File.stat(account.media_attachments.first.file.path).mode }
end

def not_change_suspended_flag
not_change(account, :suspended?)
end
end

Expand Down

0 comments on commit 832b92a

Please sign in to comment.