about summary refs log tree commit diff
path: root/spec/controllers/api/v1/push
diff options
context:
space:
mode:
authorNick Schonning <nschonni@gmail.com>2023-02-19 21:17:41 -0500
committerGitHub <noreply@github.com>2023-02-20 11:17:41 +0900
commit5179c47087e7807162f1466ec61a797586de007f (patch)
tree106d584a459714b39a3b2fe1a87492fa2cdedc74 /spec/controllers/api/v1/push
parentaef0051fd0723ff03175a8851497056ed07d1a83 (diff)
Autofix Rubocops RSpec/ScatteredLet (#23725)
Diffstat (limited to 'spec/controllers/api/v1/push')
-rw-r--r--spec/controllers/api/v1/push/subscriptions_controller_spec.rb14
1 files changed, 6 insertions, 8 deletions
diff --git a/spec/controllers/api/v1/push/subscriptions_controller_spec.rb b/spec/controllers/api/v1/push/subscriptions_controller_spec.rb
index 67f09da2d..168191468 100644
--- a/spec/controllers/api/v1/push/subscriptions_controller_spec.rb
+++ b/spec/controllers/api/v1/push/subscriptions_controller_spec.rb
@@ -5,13 +5,7 @@ require 'rails_helper'
 describe Api::V1::Push::SubscriptionsController do
   render_views
 
-  let(:user)  { Fabricate(:user) }
-  let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: 'push') }
-
-  before do
-    allow(controller).to receive(:doorkeeper_token) { token }
-  end
-
+  let(:user) { Fabricate(:user) }
   let(:create_payload) do
     {
       subscription: {
@@ -23,7 +17,6 @@ describe Api::V1::Push::SubscriptionsController do
       },
     }.with_indifferent_access
   end
-
   let(:alerts_payload) do
     {
       data: {
@@ -41,6 +34,11 @@ describe Api::V1::Push::SubscriptionsController do
       },
     }.with_indifferent_access
   end
+  let(:token) { Fabricate(:accessible_access_token, resource_owner_id: user.id, scopes: 'push') }
+
+  before do
+    allow(controller).to receive(:doorkeeper_token) { token }
+  end
 
   describe 'POST #create' do
     before do