Sha256: 1eacb70c7b00884c7f8ed9d40b044ad4ba81cde8266419b8948dd48246de6568
Contents?: true
Size: 762 Bytes
Versions: 6
Compression:
Stored size: 762 Bytes
Contents
require 'spec_helper' module Spree describe Order, type: :model do let(:order) { Order.create } let(:shirt) { create(:variant) } context "adds item to cart and activates promo" do let(:promotion) { Promotion.create name: 'Huhu' } let(:calculator) { Calculator::FlatPercentItemTotal.new(preferred_flat_percent: 10) } let!(:action) { Promotion::Actions::CreateAdjustment.create(promotion: promotion, calculator: calculator) } before { order.contents.add(shirt, 1) } context "item quantity changes" do it "recalculates order adjustments" do expect { order.contents.add(shirt, 3) }.to change { order.adjustments.eligible.pluck(:amount) } end end end end end
Version data entries
6 entries across 6 versions & 1 rubygems