about summary refs log tree commit diff
path: root/spec/controllers/admin
diff options
context:
space:
mode:
authorNick Schonning <nschonni@gmail.com>2023-02-19 23:00:48 -0500
committerGitHub <noreply@github.com>2023-02-20 05:00:48 +0100
commit38a1d8bb85da6c7a52a3bde28af368b8d2104d02 (patch)
tree31177e4c677da7ad7afc1c0fbda52b3146998339 /spec/controllers/admin
parent63e63538861bd850a38a282e37de046639afa993 (diff)
Autofix Rubocop RSpec/ImplicitSubject (#23721)
Diffstat (limited to 'spec/controllers/admin')
-rw-r--r--spec/controllers/admin/accounts_controller_spec.rb32
-rw-r--r--spec/controllers/admin/instances_controller_spec.rb4
2 files changed, 18 insertions, 18 deletions
diff --git a/spec/controllers/admin/accounts_controller_spec.rb b/spec/controllers/admin/accounts_controller_spec.rb
index f5d68a8ad..fdc98ed46 100644
--- a/spec/controllers/admin/accounts_controller_spec.rb
+++ b/spec/controllers/admin/accounts_controller_spec.rb
@@ -83,7 +83,7 @@ RSpec.describe Admin::AccountsController, type: :controller do
         let(:target_role) { UserRole.find_by(name: 'Admin') }
 
         it 'fails to memorialize account' do
-          is_expected.to have_http_status 403
+          expect(subject).to have_http_status 403
           expect(account.reload).to_not be_memorial
         end
       end
@@ -92,7 +92,7 @@ RSpec.describe Admin::AccountsController, type: :controller do
         let(:target_role) { UserRole.find_by(name: 'Moderator') }
 
         it 'succeeds in memorializing account' do
-          is_expected.to redirect_to admin_account_path(account.id)
+          expect(subject).to redirect_to admin_account_path(account.id)
           expect(account.reload).to be_memorial
         end
       end
@@ -105,7 +105,7 @@ RSpec.describe Admin::AccountsController, type: :controller do
         let(:target_role) { UserRole.find_by(name: 'Admin') }
 
         it 'fails to memorialize account' do
-          is_expected.to have_http_status 403
+          expect(subject).to have_http_status 403
           expect(account.reload).to_not be_memorial
         end
       end
@@ -114,7 +114,7 @@ RSpec.describe Admin::AccountsController, type: :controller do
         let(:target_role) { UserRole.find_by(name: 'Moderator') }
 
         it 'fails to memorialize account' do
-          is_expected.to have_http_status 403
+          expect(subject).to have_http_status 403
           expect(account.reload).to_not be_memorial
         end
       end
@@ -132,7 +132,7 @@ RSpec.describe Admin::AccountsController, type: :controller do
       let(:role) { UserRole.find_by(name: 'Admin') }
 
       it 'succeeds in enabling account' do
-        is_expected.to redirect_to admin_account_path(account.id)
+        expect(subject).to redirect_to admin_account_path(account.id)
         expect(user.reload).to_not be_disabled
       end
     end
@@ -141,7 +141,7 @@ RSpec.describe Admin::AccountsController, type: :controller do
       let(:role) { UserRole.everyone }
 
       it 'fails to enable account' do
-        is_expected.to have_http_status 403
+        expect(subject).to have_http_status 403
         expect(user.reload).to be_disabled
       end
     end
@@ -162,12 +162,12 @@ RSpec.describe Admin::AccountsController, type: :controller do
       let(:role) { UserRole.find_by(name: 'Admin') }
 
       it 'succeeds in approving account' do
-        is_expected.to redirect_to admin_accounts_path(status: 'pending')
+        expect(subject).to redirect_to admin_accounts_path(status: 'pending')
         expect(user.reload).to be_approved
       end
 
       it 'logs action' do
-        is_expected.to have_http_status 302
+        expect(subject).to have_http_status 302
 
         log_item = Admin::ActionLog.last
 
@@ -182,7 +182,7 @@ RSpec.describe Admin::AccountsController, type: :controller do
       let(:role) { UserRole.everyone }
 
       it 'fails to approve account' do
-        is_expected.to have_http_status 403
+        expect(subject).to have_http_status 403
         expect(user.reload).to_not be_approved
       end
     end
@@ -203,11 +203,11 @@ RSpec.describe Admin::AccountsController, type: :controller do
       let(:role) { UserRole.find_by(name: 'Admin') }
 
       it 'succeeds in rejecting account' do
-        is_expected.to redirect_to admin_accounts_path(status: 'pending')
+        expect(subject).to redirect_to admin_accounts_path(status: 'pending')
       end
 
       it 'logs action' do
-        is_expected.to have_http_status 302
+        expect(subject).to have_http_status 302
 
         log_item = Admin::ActionLog.last
 
@@ -222,7 +222,7 @@ RSpec.describe Admin::AccountsController, type: :controller do
       let(:role) { UserRole.everyone }
 
       it 'fails to reject account' do
-        is_expected.to have_http_status 403
+        expect(subject).to have_http_status 403
         expect(user.reload).to_not be_approved
       end
     end
@@ -242,7 +242,7 @@ RSpec.describe Admin::AccountsController, type: :controller do
       let(:role) { UserRole.find_by(name: 'Admin') }
 
       it 'succeeds in redownloading' do
-        is_expected.to redirect_to admin_account_path(account.id)
+        expect(subject).to redirect_to admin_account_path(account.id)
       end
     end
 
@@ -250,7 +250,7 @@ RSpec.describe Admin::AccountsController, type: :controller do
       let(:role) { UserRole.everyone }
 
       it 'fails to redownload' do
-        is_expected.to have_http_status 403
+        expect(subject).to have_http_status 403
       end
     end
   end
@@ -265,7 +265,7 @@ RSpec.describe Admin::AccountsController, type: :controller do
       let(:role) { UserRole.find_by(name: 'Admin') }
 
       it 'succeeds in removing avatar' do
-        is_expected.to redirect_to admin_account_path(account.id)
+        expect(subject).to redirect_to admin_account_path(account.id)
       end
     end
 
@@ -273,7 +273,7 @@ RSpec.describe Admin::AccountsController, type: :controller do
       let(:role) { UserRole.everyone }
 
       it 'fails to remove avatar' do
-        is_expected.to have_http_status 403
+        expect(subject).to have_http_status 403
       end
     end
   end
diff --git a/spec/controllers/admin/instances_controller_spec.rb b/spec/controllers/admin/instances_controller_spec.rb
index a7e348b1c..4716e486a 100644
--- a/spec/controllers/admin/instances_controller_spec.rb
+++ b/spec/controllers/admin/instances_controller_spec.rb
@@ -42,7 +42,7 @@ RSpec.describe Admin::InstancesController, type: :controller do
       let(:role) { UserRole.find_by(name: 'Admin') }
 
       it 'succeeds in purging instance' do
-        is_expected.to redirect_to admin_instances_path
+        expect(subject).to redirect_to admin_instances_path
       end
     end
 
@@ -50,7 +50,7 @@ RSpec.describe Admin::InstancesController, type: :controller do
       let(:role) { nil }
 
       it 'fails to purge instance' do
-        is_expected.to have_http_status 403
+        expect(subject).to have_http_status 403
       end
     end
   end