diff --git a/spec/controllers/history_controller_spec.rb b/spec/controllers/history_controller_spec.rb index b1118ca38..d37ad92fe 100644 --- a/spec/controllers/history_controller_spec.rb +++ b/spec/controllers/history_controller_spec.rb @@ -13,7 +13,7 @@ context "with a destination" do before do - expect_any_instance_of(HistoryStack).to receive( + allow_any_instance_of(HistoryStack).to receive( :pop_to_origin, ).and_return("/origin") end @@ -26,7 +26,7 @@ context "without a destination" do before do - expect_any_instance_of(HistoryStack).to receive( + allow_any_instance_of(HistoryStack).to receive( :pop_to_origin, ).and_return(nil) end @@ -43,7 +43,7 @@ context "with a destination" do before do - expect_any_instance_of(HistoryStack).to receive(:pop_back).and_return( + allow_any_instance_of(HistoryStack).to receive(:pop_back).and_return( "/previous", ) end @@ -56,7 +56,7 @@ context "without a destination" do before do - expect_any_instance_of(HistoryStack).to receive(:pop_back).and_return( + allow_any_instance_of(HistoryStack).to receive(:pop_back).and_return( nil, ) end diff --git a/spec/jobs/update_dqt_match_job_spec.rb b/spec/jobs/update_dqt_match_job_spec.rb index 8433f86d4..808d4371f 100644 --- a/spec/jobs/update_dqt_match_job_spec.rb +++ b/spec/jobs/update_dqt_match_job_spec.rb @@ -47,7 +47,7 @@ }, ] - expect(DQT::Client::FindTeachers).to receive(:call).with( + allow(DQT::Client::FindTeachers).to receive(:call).with( application_form:, ).and_return(results) diff --git a/spec/jobs/update_dqttrn_request_job_spec.rb b/spec/jobs/update_dqttrn_request_job_spec.rb index deb4c8a2e..b707004d1 100644 --- a/spec/jobs/update_dqttrn_request_job_spec.rb +++ b/spec/jobs/update_dqttrn_request_job_spec.rb @@ -21,7 +21,7 @@ context "with a successful response" do before do - expect(DQT::Client::CreateTRNRequest).to receive(:call).and_return( + allow(DQT::Client::CreateTRNRequest).to receive(:call).and_return( { potential_duplicate: false, trn: "abcdef", @@ -58,7 +58,7 @@ context "with a failure response" do before do - expect(DQT::Client::CreateTRNRequest).to receive(:call).and_raise( + allow(DQT::Client::CreateTRNRequest).to receive(:call).and_raise( Faraday::BadRequestError.new(StandardError.new), ) end @@ -96,7 +96,7 @@ context "with a potential duplicate response" do before do - expect(DQT::Client::CreateTRNRequest).to receive(:call).and_return( + allow(DQT::Client::CreateTRNRequest).to receive(:call).and_return( { potential_duplicate: true }, ) end @@ -134,7 +134,7 @@ context "with a successful response" do before do - expect(DQT::Client::ReadTRNRequest).to receive(:call).and_return( + allow(DQT::Client::ReadTRNRequest).to receive(:call).and_return( { potential_duplicate: false, trn: "abcdef", @@ -171,7 +171,7 @@ context "with a failure response" do before do - expect(DQT::Client::ReadTRNRequest).to receive(:call).and_raise( + allow(DQT::Client::ReadTRNRequest).to receive(:call).and_raise( Faraday::BadRequestError.new(StandardError.new), ) end @@ -209,7 +209,7 @@ context "with a potential duplicate response" do before do - expect(DQT::Client::ReadTRNRequest).to receive(:call).and_return( + allow(DQT::Client::ReadTRNRequest).to receive(:call).and_return( { potential_duplicate: true }, ) end diff --git a/spec/lib/dqt/client/create_trn_request_spec.rb b/spec/lib/dqt/client/create_trn_request_spec.rb index 3f212c0c8..3b94b2ca0 100644 --- a/spec/lib/dqt/client/create_trn_request_spec.rb +++ b/spec/lib/dqt/client/create_trn_request_spec.rb @@ -9,7 +9,7 @@ let(:application_form) { create(:application_form) } before do - expect(DQT::TRNRequestParams).to receive(:call).with( + allow(DQT::TRNRequestParams).to receive(:call).with( application_form:, ).and_return("body") end diff --git a/spec/view_objects/assessor_interface/application_forms_index_view_object_spec.rb b/spec/view_objects/assessor_interface/application_forms_index_view_object_spec.rb index 619e9aea7..b36ed93a5 100644 --- a/spec/view_objects/assessor_interface/application_forms_index_view_object_spec.rb +++ b/spec/view_objects/assessor_interface/application_forms_index_view_object_spec.rb @@ -33,7 +33,7 @@ context "with an assessor filter" do before do - expect_any_instance_of(Filters::Assessor).to receive( + allow_any_instance_of(Filters::Assessor).to receive( :apply, ).and_return(ApplicationForm.none) end @@ -43,9 +43,9 @@ context "with a country filter" do before do - expect_any_instance_of(Filters::Country).to receive( - :apply, - ).and_return(ApplicationForm.none) + allow_any_instance_of(Filters::Country).to receive(:apply).and_return( + ApplicationForm.none, + ) end it { is_expected.to be_empty } @@ -53,7 +53,7 @@ context "with a name filter" do before do - expect_any_instance_of(Filters::Name).to receive(:apply).and_return( + allow_any_instance_of(Filters::Name).to receive(:apply).and_return( ApplicationForm.none, ) end @@ -63,7 +63,7 @@ context "with a reference filter" do before do - expect_any_instance_of(Filters::Reference).to receive( + allow_any_instance_of(Filters::Reference).to receive( :apply, ).and_return(ApplicationForm.none) end @@ -73,7 +73,7 @@ context "with an action required by filter" do before do - expect_any_instance_of(Filters::ActionRequiredBy).to receive( + allow_any_instance_of(Filters::ActionRequiredBy).to receive( :apply, ).and_return(ApplicationForm.none) end @@ -83,9 +83,9 @@ context "with a stage filter" do before do - expect_any_instance_of(Filters::ShowAll).to receive( - :apply, - ).and_return(ApplicationForm.none) + allow_any_instance_of(Filters::ShowAll).to receive(:apply).and_return( + ApplicationForm.none, + ) end it { is_expected.to be_empty } @@ -93,7 +93,7 @@ context "with show all filter" do before do - expect_any_instance_of(Filters::Stage).to receive(:apply).and_return( + allow_any_instance_of(Filters::Stage).to receive(:apply).and_return( ApplicationForm.none, ) end