about summary refs log tree commit diff
path: root/spec/controllers/activitypub
diff options
context:
space:
mode:
authorNick Schonning <nschonni@gmail.com>2023-02-19 23:24:14 -0500
committerGitHub <noreply@github.com>2023-02-20 13:24:14 +0900
commit4552685f6bd400666ec4058783eeabb11568e575 (patch)
treeab708e0d54b9309f96ef0e4d17e8afd32221c5c6 /spec/controllers/activitypub
parent4ea1e0fceb0c0c5fee014a99f81f8f13a16f6dde (diff)
Autofix Rubocop RSpec/LeadingSubject (#23670)
Diffstat (limited to 'spec/controllers/activitypub')
-rw-r--r--spec/controllers/activitypub/collections_controller_spec.rb4
-rw-r--r--spec/controllers/activitypub/followers_synchronizations_controller_spec.rb4
-rw-r--r--spec/controllers/activitypub/inboxes_controller_spec.rb4
-rw-r--r--spec/controllers/activitypub/outboxes_controller_spec.rb4
4 files changed, 8 insertions, 8 deletions
diff --git a/spec/controllers/activitypub/collections_controller_spec.rb b/spec/controllers/activitypub/collections_controller_spec.rb
index 19c0e0a64..77901131e 100644
--- a/spec/controllers/activitypub/collections_controller_spec.rb
+++ b/spec/controllers/activitypub/collections_controller_spec.rb
@@ -35,11 +35,11 @@ RSpec.describe ActivityPub::CollectionsController, type: :controller do
   describe 'GET #show' do
     context 'when id is "featured"' do
       context 'without signature' do
-        let(:remote_account) { nil }
+        subject(:body) { body_as_json }
 
         subject(:response) { get :show, params: { id: 'featured', account_username: account.username } }
 
-        subject(:body) { body_as_json }
+        let(:remote_account) { nil }
 
         it 'returns http success' do
           expect(response).to have_http_status(200)
diff --git a/spec/controllers/activitypub/followers_synchronizations_controller_spec.rb b/spec/controllers/activitypub/followers_synchronizations_controller_spec.rb
index 893c8e14f..6ec756d3c 100644
--- a/spec/controllers/activitypub/followers_synchronizations_controller_spec.rb
+++ b/spec/controllers/activitypub/followers_synchronizations_controller_spec.rb
@@ -32,11 +32,11 @@ RSpec.describe ActivityPub::FollowersSynchronizationsController, type: :controll
     end
 
     context 'with signature from example.com' do
-      let(:remote_account) { Fabricate(:account, domain: 'example.com', uri: 'https://example.com/instance') }
+      subject(:body) { body_as_json }
 
       subject(:response) { get :show, params: { account_username: account.username } }
 
-      subject(:body) { body_as_json }
+      let(:remote_account) { Fabricate(:account, domain: 'example.com', uri: 'https://example.com/instance') }
 
       it 'returns http success' do
         expect(response).to have_http_status(200)
diff --git a/spec/controllers/activitypub/inboxes_controller_spec.rb b/spec/controllers/activitypub/inboxes_controller_spec.rb
index 7f4d6b2d3..8d4084648 100644
--- a/spec/controllers/activitypub/inboxes_controller_spec.rb
+++ b/spec/controllers/activitypub/inboxes_controller_spec.rb
@@ -22,10 +22,10 @@ RSpec.describe ActivityPub::InboxesController, type: :controller do
       end
 
       context 'for a specific account' do
-        let(:account) { Fabricate(:account) }
-
         subject(:response) { post :create, params: { account_username: account.username }, body: '{}' }
 
+        let(:account) { Fabricate(:account) }
+
         context 'when account is permanently suspended' do
           before do
             account.suspend!
diff --git a/spec/controllers/activitypub/outboxes_controller_spec.rb b/spec/controllers/activitypub/outboxes_controller_spec.rb
index f84a902ea..7369ee413 100644
--- a/spec/controllers/activitypub/outboxes_controller_spec.rb
+++ b/spec/controllers/activitypub/outboxes_controller_spec.rb
@@ -33,11 +33,11 @@ RSpec.describe ActivityPub::OutboxesController, type: :controller do
 
   describe 'GET #show' do
     context 'without signature' do
-      let(:remote_account) { nil }
+      subject(:body) { body_as_json }
 
       subject(:response) { get :show, params: { account_username: account.username, page: page } }
 
-      subject(:body) { body_as_json }
+      let(:remote_account) { nil }
 
       context 'with page not requested' do
         let(:page) { nil }