mirror of
https://github.com/mastodon/mastodon.git
synced 2024-11-26 23:41:52 +00:00
cb5b5cb5f7
* No need to re-require sidekiq plugins, they are required via Gemfile * Add derailed_benchmarks tool, no need to require TTY gems in Gemfile * Replace ruby-oembed with FetchOEmbedService Reduce startup by 45382 allocated objects * Remove preloaded JSON-LD in favour of caching HTTP responses Reduce boot RAM by about 6 MiB * Fix tests * Fix test suite by stubbing out JSON-LD contexts
26 lines
861 B
Ruby
26 lines
861 B
Ruby
require 'rails_helper'
|
|
|
|
RSpec.describe ReportService, type: :service do
|
|
subject { described_class.new }
|
|
|
|
let(:source_account) { Fabricate(:account) }
|
|
|
|
context 'for a remote account' do
|
|
let(:remote_account) { Fabricate(:account, domain: 'example.com', protocol: :activitypub, inbox_url: 'http://example.com/inbox') }
|
|
|
|
before do
|
|
stub_request(:post, 'http://example.com/inbox').to_return(status: 200)
|
|
end
|
|
|
|
it 'sends ActivityPub payload when forward is true' do
|
|
subject.call(source_account, remote_account, forward: true)
|
|
expect(a_request(:post, 'http://example.com/inbox')).to have_been_made
|
|
end
|
|
|
|
it 'does not send anything when forward is false' do
|
|
subject.call(source_account, remote_account, forward: false)
|
|
expect(a_request(:post, 'http://example.com/inbox')).to_not have_been_made
|
|
end
|
|
end
|
|
end
|