Fix test
This commit is contained in:
parent
e20c9ad106
commit
4f64ba26dc
3 changed files with 8 additions and 8 deletions
|
@ -30,7 +30,7 @@ RSpec.describe ActivityPub::Activity::Create do
|
|||
stub_request(:get, 'http://example.com/attachment.png').to_return(request_fixture('avatar.txt'))
|
||||
stub_request(:get, 'http://example.com/emoji.png').to_return(body: attachment_fixture('emojo.png'))
|
||||
stub_request(:get, 'http://example.com/emojib.png').to_return(body: attachment_fixture('emojo.png'), headers: { 'Content-Type' => 'application/octet-stream' })
|
||||
stub_request(:get, 'http://example.com/conversation').to_return(body: Oj.dump(conversation))
|
||||
stub_request(:get, 'http://example.com/conversation').to_return(body: Oj.dump(conversation), headers: { 'Content-Type' => 'application/activity+json' })
|
||||
stub_request(:get, 'http://example.com/invalid-conversation').to_return(status: 404)
|
||||
end
|
||||
|
||||
|
@ -1158,8 +1158,8 @@ RSpec.describe ActivityPub::Activity::Create do
|
|||
end
|
||||
|
||||
before do
|
||||
stub_request(:get, 'https://foo.test').to_return(status: 200, body: Oj.dump(actor_json))
|
||||
stub_request(:get, 'https://foo.test/.well-known/webfinger?resource=acct:actor@foo.test').to_return(status: 200, body: Oj.dump(webfinger))
|
||||
stub_request(:get, 'https://foo.test').to_return(status: 200, body: Oj.dump(actor_json), headers: { 'Content-Type': 'application/activity+json' })
|
||||
stub_request(:get, 'https://foo.test/.well-known/webfinger?resource=acct:actor@foo.test').to_return(status: 200, body: Oj.dump(webfinger), headers: { 'Content-Type': 'application/activity+json' })
|
||||
stub_request(:post, 'https://foo.test/inbox').to_return(status: 200)
|
||||
stub_request(:get, 'https://foo.test/.well-known/nodeinfo').to_return(status: 200)
|
||||
subject.perform
|
||||
|
|
|
@ -60,8 +60,8 @@ RSpec.describe ActivityPub::Activity::Like do
|
|||
before do
|
||||
stub_request(:get, 'http://example.com/emoji.png').to_return(body: attachment_fixture('emojo.png'))
|
||||
stub_request(:get, 'http://foo.bar/emoji2.png').to_return(body: attachment_fixture('emojo.png'))
|
||||
stub_request(:get, 'https://example.com/aaa').to_return(status: 200, body: Oj.dump(original_emoji))
|
||||
stub_request(:get, 'https://example.com/invalid').to_return(status: 200, body: Oj.dump(original_invalid_emoji))
|
||||
stub_request(:get, 'https://example.com/aaa').to_return(status: 200, body: Oj.dump(original_emoji), headers: { 'Content-Type': 'application/activity+json' })
|
||||
stub_request(:get, 'https://example.com/invalid').to_return(status: 200, body: Oj.dump(original_invalid_emoji), headers: { 'Content-Type': 'application/activity+json' })
|
||||
end
|
||||
|
||||
let(:json) do
|
||||
|
|
|
@ -54,7 +54,7 @@ RSpec.describe ActivityPub::FetchReferencesService, type: :service do
|
|||
subject { described_class.new.call(status, collection_uri) }
|
||||
|
||||
before do
|
||||
stub_request(:get, collection_uri).to_return(status: 200, body: Oj.dump(payload))
|
||||
stub_request(:get, collection_uri).to_return(status: 200, body: Oj.dump(payload), headers: { 'Content-Type': 'application/activity+json' })
|
||||
end
|
||||
|
||||
it 'first 8 items are returned' do
|
||||
|
@ -83,7 +83,7 @@ RSpec.describe ActivityPub::FetchReferencesService, type: :service do
|
|||
subject { described_class.new.call(status, collection_uri) }
|
||||
|
||||
before do
|
||||
stub_request(:get, collection_uri).to_return(status: 200, body: Oj.dump(payload))
|
||||
stub_request(:get, collection_uri).to_return(status: 200, body: Oj.dump(payload), headers: { 'Content-Type': 'application/activity+json' })
|
||||
end
|
||||
|
||||
it 'first 8 items are returned' do
|
||||
|
@ -116,7 +116,7 @@ RSpec.describe ActivityPub::FetchReferencesService, type: :service do
|
|||
subject { described_class.new.call(status, collection_uri) }
|
||||
|
||||
before do
|
||||
stub_request(:get, collection_uri).to_return(status: 200, body: Oj.dump(payload))
|
||||
stub_request(:get, collection_uri).to_return(status: 200, body: Oj.dump(payload), headers: { 'Content-Type': 'application/activity+json' })
|
||||
end
|
||||
|
||||
it 'first 8 items are returned' do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue