summaryrefslogtreecommitdiff
path: root/spec/super_good/solidus_taxjar_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/super_good/solidus_taxjar_spec.rb')
-rw-r--r--spec/super_good/solidus_taxjar_spec.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/super_good/solidus_taxjar_spec.rb b/spec/super_good/solidus_taxjar_spec.rb
index 6236b2f..d9ef1d4 100644
--- a/spec/super_good/solidus_taxjar_spec.rb
+++ b/spec/super_good/solidus_taxjar_spec.rb
@@ -73,5 +73,20 @@ RSpec.describe SuperGood::SolidusTaxjar do
let(:spree_line_item) { Spree::LineItem.new }
it { is_expected.to eq "Sales Tax" }
end
+
+ describe ".shipping_calculator" do
+ subject { described_class.shipping_calculator.call(order) }
+
+ let(:order) { create :order }
+ let(:shipment) { create :shipment, order: order, cost: 20 }
+
+ before do
+ create :adjustment, order: order, adjustable: shipment, amount: -10, eligible: true, source: create(:shipping_rate, shipment: shipment)
+ end
+
+ it "returns the shipment total including promotions" do
+ expect(subject).to eq(10)
+ end
+ end
end
end