about summary refs log tree commit diff
path: root/spec/lib/activitypub/activity/announce_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib/activitypub/activity/announce_spec.rb')
-rw-r--r--spec/lib/activitypub/activity/announce_spec.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/spec/lib/activitypub/activity/announce_spec.rb b/spec/lib/activitypub/activity/announce_spec.rb
index adb13acc2..b3257e881 100644
--- a/spec/lib/activitypub/activity/announce_spec.rb
+++ b/spec/lib/activitypub/activity/announce_spec.rb
@@ -1,6 +1,8 @@
 require 'rails_helper'
 
 RSpec.describe ActivityPub::Activity::Announce do
+  subject { described_class.new(json, sender) }
+
   let(:sender)    { Fabricate(:account, followers_url: 'http://example.com/followers', uri: 'https://example.com/actor') }
   let(:recipient) { Fabricate(:account) }
   let(:status)    { Fabricate(:status, account: recipient) }
@@ -27,8 +29,6 @@ RSpec.describe ActivityPub::Activity::Announce do
     }
   end
 
-  subject { described_class.new(json, sender) }
-
   describe '#perform' do
     context 'when sender is followed by a local account' do
       before do
@@ -110,13 +110,13 @@ RSpec.describe ActivityPub::Activity::Announce do
     end
 
     context 'when the sender is relayed' do
+      subject { described_class.new(json, sender, relayed_through_actor: relay_account) }
+
       let!(:relay_account) { Fabricate(:account, inbox_url: 'https://relay.example.com/inbox') }
       let!(:relay) { Fabricate(:relay, inbox_url: 'https://relay.example.com/inbox') }
 
       let(:object_json) { 'https://example.com/actor/hello-world' }
 
-      subject { described_class.new(json, sender, relayed_through_actor: relay_account) }
-
       before do
         stub_request(:get, 'https://example.com/actor/hello-world').to_return(body: Oj.dump(unknown_object_json))
       end