Sha256: d353b61dc27ad9fdca93a50d4682bbe12cb8f9cc85e899266b9ea2b66d4e6fa6
Contents?: true
Size: 596 Bytes
Versions: 6
Compression:
Stored size: 596 Bytes
Contents
require 'spec_helper' module Spree describe Spree::PromotionRule, type: :model do class BadTestRule < Spree::PromotionRule; end class TestRule < Spree::PromotionRule def eligible? true end end it "should force developer to implement eligible? method" do expect { BadTestRule.new.eligible? }.to raise_error(ArgumentError) end it "validates unique rules for a promotion" do p1 = TestRule.new p1.promotion_id = 1 p1.save p2 = TestRule.new p2.promotion_id = 1 expect(p2).not_to be_valid end end end
Version data entries
6 entries across 6 versions & 1 rubygems