Sha256: 0254872a75c2bd15d6e40a29677570f183ef6383a77936768ad830498edea89f
Contents?: true
Size: 774 Bytes
Versions: 48
Compression:
Stored size: 774 Bytes
Contents
# frozen_string_literal: true 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
48 entries across 48 versions & 2 rubygems