diff options
author | Matt Jankowski <matt@jankowski.online> | 2024-01-26 11:21:31 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-26 16:21:31 +0000 |
commit | 2f8656334d341839bc471d1850850d80f920f01c (patch) | |
tree | ebf47a3e7d040b16e3a5245e165269c466c32e0a | |
parent | 9cc1817bb493799b89d1171a1d632abb9791340c (diff) |
Combine double subjects in `admin/accounts` controller spec (#28936)
-rw-r--r-- | spec/controllers/admin/accounts_controller_spec.rb | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/spec/controllers/admin/accounts_controller_spec.rb b/spec/controllers/admin/accounts_controller_spec.rb index 1882ea83883..ef3053b6b35 100644 --- a/spec/controllers/admin/accounts_controller_spec.rb +++ b/spec/controllers/admin/accounts_controller_spec.rb @@ -153,13 +153,9 @@ RSpec.describe Admin::AccountsController do context 'when user is admin' do let(:role) { UserRole.find_by(name: 'Admin') } - it 'succeeds in approving account' do + it 'succeeds in approving account and logs action' do expect(subject).to redirect_to admin_accounts_path(status: 'pending') expect(user.reload).to be_approved - end - - it 'logs action' do - expect(subject).to have_http_status 302 expect(latest_admin_action_log) .to be_present @@ -195,12 +191,8 @@ RSpec.describe Admin::AccountsController do context 'when user is admin' do let(:role) { UserRole.find_by(name: 'Admin') } - it 'succeeds in rejecting account' do + it 'succeeds in rejecting account and logs action' do expect(subject).to redirect_to admin_accounts_path(status: 'pending') - end - - it 'logs action' do - expect(subject).to have_http_status 302 expect(latest_admin_action_log) .to be_present @@ -286,12 +278,9 @@ RSpec.describe Admin::AccountsController do context 'when user is admin' do let(:role) { UserRole.find_by(name: 'Admin') } - it 'succeeds in removing email blocks' do + it 'succeeds in removing email blocks and redirects to admin account path' do expect { subject }.to change { CanonicalEmailBlock.where(reference_account: account).count }.from(1).to(0) - end - it 'redirects to admin account path' do - subject expect(response).to redirect_to admin_account_path(account.id) end end |