Sha256: a175fcd018fa02416ce8fbc48211b271875ae9367c4e1337726445ff45077e1d
Contents?: true
Size: 584 Bytes
Versions: 6
Compression:
Stored size: 584 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 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