From e9e15cd7c4124fc9e248e3f0e27713da01bc3c5c Mon Sep 17 00:00:00 2001 From: Alexander Date: Wed, 16 Oct 2024 16:38:40 +0300 Subject: [PATCH] Redirect to index after report deletion --- modules/reporting/app/controllers/cost_reports_controller.rb | 2 +- .../reporting/spec/controllers/cost_reports_controller_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/reporting/app/controllers/cost_reports_controller.rb b/modules/reporting/app/controllers/cost_reports_controller.rb index 71567b53dad7..edb12e8baf26 100644 --- a/modules/reporting/app/controllers/cost_reports_controller.rb +++ b/modules/reporting/app/controllers/cost_reports_controller.rb @@ -152,7 +152,7 @@ def destroy else raise ActiveRecord::RecordNotFound end - redirect_to action: "index", default: 1 + redirect_to action: "index", default: 1, id: nil end ## diff --git a/modules/reporting/spec/controllers/cost_reports_controller_spec.rb b/modules/reporting/spec/controllers/cost_reports_controller_spec.rb index 8bcd635c228e..c8a02d04c3e2 100644 --- a/modules/reporting/spec/controllers/cost_reports_controller_spec.rb +++ b/modules/reporting/spec/controllers/cost_reports_controller_spec.rb @@ -70,7 +70,7 @@ end it "redirected" do - expect(response).to have_http_status(:redirect) + expect(response).to redirect_to(cost_reports_url(default: 1)) end end