Misc coverage improvements re: sidekiq/inline (#28651)
This commit is contained in:
parent
68f06f1fd4
commit
5dc634796a
3 changed files with 95 additions and 1 deletions
|
@ -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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue