Sha256: 7af84789c14dfdd06aa2a70ff8238ac4fc7f4db71f8304fd2f75960db225e509
Contents?: true
Size: 800 Bytes
Versions: 5
Compression:
Stored size: 800 Bytes
Contents
require 'spec_helper' describe Spree::Admin::PromotionActionsController, type: :controller do stub_authorization! let!(:promotion) { create(:promotion) } it "can create a promotion action of a valid type" do post :create, promotion_id: promotion.id, action_type: "Spree::Promotion::Actions::CreateAdjustment" expect(response).to be_redirect expect(response).to redirect_to spree.edit_admin_promotion_path(promotion) expect(promotion.actions.count).to eq(1) end it "can not create a promotion action of an invalid type" do post :create, promotion_id: promotion.id, action_type: "Spree::InvalidType" expect(response).to be_redirect expect(response).to redirect_to spree.edit_admin_promotion_path(promotion) expect(promotion.rules.count).to eq(0) end end
Version data entries
5 entries across 5 versions & 1 rubygems