Sha256: 97eeec74bd5200f66803fdcfeea5fcf73d58e11b281eb3c7033781366064d9b1
Contents?: true
Size: 743 Bytes
Versions: 11
Compression:
Stored size: 743 Bytes
Contents
require 'rails_helper' RSpec.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
11 entries across 11 versions & 1 rubygems