From 685eaa04d4037886e4d7f4e346183a04c292bf0a Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Fri, 26 Jan 2024 11:30:30 -0500 Subject: [PATCH] Combine double subject in admin/statuses controller shared example (#28940) --- spec/controllers/admin/statuses_controller_spec.rb | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/spec/controllers/admin/statuses_controller_spec.rb b/spec/controllers/admin/statuses_controller_spec.rb index dc5e28e972..4e8bf9ead6 100644 --- a/spec/controllers/admin/statuses_controller_spec.rb +++ b/spec/controllers/admin/statuses_controller_spec.rb @@ -60,16 +60,14 @@ describe Admin::StatusesController do shared_examples 'when action is report' do let(:action) { 'report' } - it 'creates a report' do + it 'creates a report and redirects to report page' do subject - report = Report.last - expect(report.target_account_id).to eq account.id - expect(report.status_ids).to eq status_ids - end - - it 'redirects to report page' do - subject + expect(Report.last) + .to have_attributes( + target_account_id: eq(account.id), + status_ids: eq(status_ids) + ) expect(response).to redirect_to(admin_report_path(Report.last.id)) end