diff --git a/app/controllers/admin/order_cycles_controller.rb b/app/controllers/admin/order_cycles_controller.rb index bb506ec9db..2e1258eaa0 100644 --- a/app/controllers/admin/order_cycles_controller.rb +++ b/app/controllers/admin/order_cycles_controller.rb @@ -48,7 +48,7 @@ module Admin @order_cycle_form = OrderCycleForm.new(@order_cycle, order_cycle_params, spree_current_user) if @order_cycle_form.save - flash[:notice] = t('.success') + flash[:success] = t('.success') render json: { success: true, edit_path: main_app.admin_order_cycle_incoming_path(@order_cycle) } else @@ -66,7 +66,7 @@ module Admin if @order_cycle_form.save update_nil_subscription_line_items_price_estimate(@order_cycle) respond_to do |format| - flash[:notice] = t('.success') if params[:reloading] == '1' + flash[:success] = t('.success') if params[:reloading] == '1' format.html { redirect_to_after_update_path } format.json { render json: { success: true } } end @@ -118,7 +118,7 @@ module Admin @order_cycle = OrderCycle.find params[:id] @order_cycle.clone! redirect_to main_app.admin_order_cycles_path, - notice: t('.success', name: @order_cycle.name) + flash: { success: t('.success', name: @order_cycle.name) } end # Send notifications to all producers who are part of the order cycle @@ -126,7 +126,7 @@ module Admin OrderCycleNotificationJob.perform_later params[:id].to_i redirect_to main_app.admin_order_cycles_path, - notice: t('.success') + flash: { success: t('.success') } end protected diff --git a/spec/controllers/admin/order_cycles_controller_spec.rb b/spec/controllers/admin/order_cycles_controller_spec.rb index 348d5374d4..0dd26d1430 100644 --- a/spec/controllers/admin/order_cycles_controller_spec.rb +++ b/spec/controllers/admin/order_cycles_controller_spec.rb @@ -252,14 +252,14 @@ module Admin it "sets flash message" do spree_put :update, params - expect(flash[:notice]).to eq('Your order cycle has been updated.') + expect(flash[:success]).to eq('Your order cycle has been updated.') end end context "when the page is not reloading" do it "does not set flash message" do spree_put :update, params - expect(flash[:notice]).to be nil + expect(flash[:success]).to be nil end end end @@ -445,7 +445,7 @@ module Admin it "redirects back to the order cycles path with a success message" do spree_post :notify_producers, id: order_cycle.id expect(response).to redirect_to admin_order_cycles_path - expect(flash[:notice]).to eq('Emails to be sent to producers have been queued for sending.') + expect(flash[:success]).to eq('Emails to be sent to producers have been queued for sending.') end end