Sha256: 43f2ece9c57bcfab9bfe4f95d65a15b3f89501826b9f064d791b236b33954a31
Contents?: true
Size: 634 Bytes
Versions: 16
Compression:
Stored size: 634 Bytes
Contents
require 'spec_helper' module Spree describe Spree::PromotionRule, type: :model do class BadTestRule < Spree::PromotionRule; end class TestRule < Spree::PromotionRule def eligible?(promotable, options = {}) true end end it "forces developer to implement eligible? method" do expect { BadTestRule.new.eligible?("promotable") }.to raise_error NotImplementedError 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
16 entries across 16 versions & 1 rubygems