|  |  | @ -57,7 +57,7 @@ RSpec.describe FetchResourceService, type: :service do | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |       let(:json) do |  |  |  |       let(:json) do | 
			
		
	
		
		
			
				
					
					|  |  |  |         { |  |  |  |         { | 
			
		
	
		
		
			
				
					
					|  |  |  |           id: 1, |  |  |  |           id: 'http://example.com/foo', | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |           '@context': ActivityPub::TagManager::CONTEXT, |  |  |  |           '@context': ActivityPub::TagManager::CONTEXT, | 
			
		
	
		
		
			
				
					
					|  |  |  |           type: 'Note', |  |  |  |           type: 'Note', | 
			
		
	
		
		
			
				
					
					|  |  |  |         }.to_json |  |  |  |         }.to_json | 
			
		
	
	
		
		
			
				
					|  |  | @ -83,27 +83,27 @@ 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 }] } |  |  |  |         it { is_expected.to eq ['http://example.com/foo', { prefetched_body: body }] } | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |       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 }] } |  |  |  |         it { is_expected.to eq ['http://example.com/foo', { prefetched_body: body }] } | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |       end |  |  |  |       end | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |       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 }] } |  |  |  |         it { is_expected.to eq ['http://example.com/foo', { prefetched_body: json }] } | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |       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 }] } |  |  |  |         it { is_expected.to eq ['http://example.com/foo', { prefetched_body: json }] } | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |       end |  |  |  |       end | 
			
		
	
		
		
			
				
					
					|  |  |  |     end |  |  |  |     end | 
			
		
	
		
		
			
				
					
					|  |  |  |   end |  |  |  |   end | 
			
		
	
	
		
		
			
				
					|  |  | 
 |