diff --git a/backend/app/controllers/spree/admin/promotions_controller.rb b/backend/app/controllers/spree/admin/promotions_controller.rb index 6fc80327448..ab5234bc6ac 100644 --- a/backend/app/controllers/spree/admin/promotions_controller.rb +++ b/backend/app/controllers/spree/admin/promotions_controller.rb @@ -5,6 +5,10 @@ class PromotionsController < ResourceController helper 'spree/promotion_rules' + def show + redirect_to action: :edit + end + def create @promotion = Spree::Promotion.new(permitted_resource_params) @promotion.codes.new(value: params[:single_code]) if params[:single_code].present? diff --git a/backend/spec/controllers/spree/admin/promotions_controller_spec.rb b/backend/spec/controllers/spree/admin/promotions_controller_spec.rb index 9841ecea9f7..eab5e750d65 100644 --- a/backend/spec/controllers/spree/admin/promotions_controller_spec.rb +++ b/backend/spec/controllers/spree/admin/promotions_controller_spec.rb @@ -7,6 +7,13 @@ let!(:promotion2) { create(:promotion, name: "name2", code: "code2", path: "path2") } let!(:category) { create :promotion_category } + describe "#show" do + it "redirects to edit" do + expect(get(:show, params: { id: promotion1.id })) + .to redirect_to(action: :edit, id: promotion1.id ) + end + end + describe "#index" do it "succeeds" do get :index