Sha256: 26beaef22ad4fd5c9c1083f0964d396111ef9a1f02eb1a3ad85e73e47ae04200
Contents?: true
Size: 599 Bytes
Versions: 10
Compression:
Stored size: 599 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
10 entries across 10 versions & 1 rubygems