Sha256: 487130ee32dd66c99cddbc4c0ba48eac1a9f1ba1b1f0498dd0bef938110a48fb
Contents?: true
Size: 736 Bytes
Versions: 48
Compression:
Stored size: 736 Bytes
Contents
require 'spec_helper' describe Spree::OrderPromotion do subject do order_promotion end let(:order_promotion) { build(:order_promotion) } describe "promotion code presence error" do subject do order_promotion.valid? order_promotion.errors[:promotion_code] end let(:order_promotion) { build(:order_promotion) } let(:promotion) { order_promotion.promotion } context "when the promotion does not have a code" do it { is_expected.to be_blank } end context "when the promotion has a code" do let!(:promotion_code) do promotion.codes << build(:promotion_code, promotion: promotion) end it { is_expected.to include("can't be blank") } end end end
Version data entries
48 entries across 48 versions & 1 rubygems