@ -71,14 +71,14 @@ RSpec.describe FetchResourceService, type: :service do
let ( :content_type ) { 'application/activity+json; charset=utf-8' }
let ( :content_type ) { 'application/activity+json; charset=utf-8' }
let ( :body ) { json }
let ( :body ) { json }
it { is_expected . to eq [ 1 , { prefetched_body : body , id : true } , :activitypub ] }
it { is_expected . to eq [ 1 , { prefetched_body : body , id : true } ] }
end
end
context 'when content type is ld+json with profile' do
context 'when content type is ld+json with profile' do
let ( :content_type ) { 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"' }
let ( :content_type ) { 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"' }
let ( :body ) { json }
let ( :body ) { json }
it { is_expected . to eq [ 1 , { prefetched_body : body , id : true } , :activitypub ] }
it { is_expected . to eq [ 1 , { prefetched_body : body , id : true } ] }
end
end
before do
before do
@ -89,14 +89,14 @@ RSpec.describe FetchResourceService, type: :service do
context 'when link header is present' do
context 'when link header is present' do
let ( :headers ) { { 'Link' = > '<http://example.com/foo>; rel="alternate"; type="application/activity+json"' , } }
let ( :headers ) { { 'Link' = > '<http://example.com/foo>; rel="alternate"; type="application/activity+json"' , } }
it { is_expected . to eq [ 1 , { prefetched_body : json , id : true } , :activitypub ] }
it { is_expected . to eq [ 1 , { prefetched_body : json , id : true } ] }
end
end
context 'when content type is text/html' do
context 'when content type is text/html' do
let ( :content_type ) { 'text/html' }
let ( :content_type ) { 'text/html' }
let ( :body ) { '<html><head><link rel="alternate" href="http://example.com/foo" type="application/activity+json"/></head></html>' }
let ( :body ) { '<html><head><link rel="alternate" href="http://example.com/foo" type="application/activity+json"/></head></html>' }
it { is_expected . to eq [ 1 , { prefetched_body : json , id : true } , :activitypub ] }
it { is_expected . to eq [ 1 , { prefetched_body : json , id : true } ] }
end
end
end
end
end
end