Misc coverage improvements re: sidekiq/inline (#28651)

This commit is contained in:
Matt Jankowski 2024-01-09 04:40:08 -05:00 committed by GitHub
parent 68f06f1fd4
commit 5dc634796a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 95 additions and 1 deletions

View file

@ -20,7 +20,8 @@ RSpec.describe RemoveStatusService, type: :service do
end
context 'when removed status is not a reblog' do
let!(:status) { PostStatusService.new.call(alice, text: "Hello @#{bob.pretty_acct} ThisIsASecret") }
let!(:media_attachment) { Fabricate(:media_attachment, account: alice) }
let!(:status) { PostStatusService.new.call(alice, text: "Hello @#{bob.pretty_acct} ThisIsASecret", media_ids: [media_attachment.id]) }
before do
FavouriteService.new.call(jeff, status)
@ -37,6 +38,14 @@ RSpec.describe RemoveStatusService, type: :service do
expect(HomeFeed.new(jeff).get(10).pluck(:id)).to_not include(status.id)
end
it 'publishes to public media timeline' do
allow(redis).to receive(:publish).with(any_args)
subject.call(status)
expect(redis).to have_received(:publish).with('timeline:public:media', Oj.dump(event: :delete, payload: status.id.to_s))
end
it 'sends Delete activity to followers' do
subject.call(status)
expect(a_request(:post, hank.inbox_url).with(