From e0bdaeab657d9a320aaf506d98ca82d41e7bfdd5 Mon Sep 17 00:00:00 2001 From: Claire Date: Tue, 17 May 2022 14:52:26 +0200 Subject: Fix NoMethodError when resolving a link that redirects to a local post (#18314) * Fix NoMethodError when resolving a link that redirects to a local post * Fix tests --- spec/services/fetch_remote_status_service_spec.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'spec/services/fetch_remote_status_service_spec.rb') diff --git a/spec/services/fetch_remote_status_service_spec.rb b/spec/services/fetch_remote_status_service_spec.rb index 0e63cc9eb..fe5f1aed1 100644 --- a/spec/services/fetch_remote_status_service_spec.rb +++ b/spec/services/fetch_remote_status_service_spec.rb @@ -1,14 +1,13 @@ require 'rails_helper' RSpec.describe FetchRemoteStatusService, type: :service do - let(:account) { Fabricate(:account) } + let(:account) { Fabricate(:account, domain: 'example.org', uri: 'https://example.org/foo') } let(:prefetched_body) { nil } - let(:valid_domain) { Rails.configuration.x.local_domain } let(:note) do { '@context': 'https://www.w3.org/ns/activitystreams', - id: "https://#{valid_domain}/@foo/1234", + id: "https://example.org/@foo/1234", type: 'Note', content: 'Lorem ipsum', attributedTo: ActivityPub::TagManager.instance.uri_for(account), @@ -20,7 +19,6 @@ RSpec.describe FetchRemoteStatusService, type: :service do let(:prefetched_body) { Oj.dump(note) } before do - account.update(uri: ActivityPub::TagManager.instance.uri_for(account)) subject end -- cgit