From 9a83ec4cda37760aad82373dc422cadbb33eddfe Mon Sep 17 00:00:00 2001 From: Jared Norman Date: Wed, 6 Feb 2019 17:10:01 -0800 Subject: Provide Spree line items to label maker --- spec/super_good/solidus_taxjar/tax_calculator_spec.rb | 4 ++-- spec/super_good/solidus_taxjar_spec.rb | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'spec') diff --git a/spec/super_good/solidus_taxjar/tax_calculator_spec.rb b/spec/super_good/solidus_taxjar/tax_calculator_spec.rb index 1899443..a13f564 100644 --- a/spec/super_good/solidus_taxjar/tax_calculator_spec.rb +++ b/spec/super_good/solidus_taxjar/tax_calculator_spec.rb @@ -24,7 +24,7 @@ RSpec.describe ::SuperGood::SolidusTaxJar::TaxCalculator do ) end - let(:line_items) { [::Spree::LineItem.new] } + let(:line_items) { [::Spree::LineItem.new(id: 33)] } let(:boring_shipment) do ::Spree::Shipment.new(id: 1, cost: 7) @@ -178,7 +178,7 @@ RSpec.describe ::SuperGood::SolidusTaxJar::TaxCalculator do before do allow(SuperGood::SolidusTaxJar.line_item_tax_label_maker) .to receive(:call) - .with(taxjar_line_item) + .with(taxjar_line_item, line_items.first) .and_return("Space Tax") end diff --git a/spec/super_good/solidus_taxjar_spec.rb b/spec/super_good/solidus_taxjar_spec.rb index 957e2e3..dafc4fb 100644 --- a/spec/super_good/solidus_taxjar_spec.rb +++ b/spec/super_good/solidus_taxjar_spec.rb @@ -45,8 +45,9 @@ RSpec.describe SuperGood::SolidusTaxJar do end describe ".line_item_tax_label_maker" do - subject { described_class.line_item_tax_label_maker.(taxjar_line_item) } + subject { described_class.line_item_tax_label_maker.(taxjar_line_item, spree_line_item) } let(:taxjar_line_item) { instance_double Taxjar::BreakdownLineItem } + let(:spree_line_item) { Spree::LineItem.new } it { is_expected.to eq "Sales Tax" } end end -- cgit v1.2.3