Sha256: 4774e21361890baa720cc73b7d06f8358992737f2c2e872b6bb1670e937d7526
Contents?: true
Size: 542 Bytes
Versions: 3
Compression:
Stored size: 542 Bytes
Contents
FactoryGirl.define do factory :promotion, class: Spree::Promotion do name 'Promo' factory :promotion_with_item_adjustment do ignore do adjustment_rate 10 end after(:create) do |promotion, evaluator| calculator = Spree::Calculator::FlatRate.new calculator.preferred_amount = evaluator.adjustment_rate action = Spree::Promotion::Actions::CreateItemAdjustments.create(:calculator => calculator) promotion.actions << action promotion.save end end end end
Version data entries
3 entries across 3 versions & 1 rubygems