diff options
author | Jared Norman <jared@super.gd> | 2019-03-14 11:27:11 -0700 |
---|---|---|
committer | Jared Norman <jared@super.gd> | 2019-03-14 11:27:11 -0700 |
commit | 23748866e8a9726fc4cb96b8868054da198188fc (patch) | |
tree | 098ebdf3f1c84a42a395d4195bb500b49e74cb3d /spec/super_good | |
parent | 945490776a137821df70111c32127ffc85b4c90b (diff) |
Add test that covers behaviour with TaxLocation
When an order doesn't have a tax_address, it will rely on the order's
store to build a "TaxAddress" for use as the "tax address which in an
ideal world would be much more address-like... but unfortunately it's
not.
Diffstat (limited to 'spec/super_good')
-rw-r--r-- | spec/super_good/solidus_taxjar/tax_calculator_spec.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/super_good/solidus_taxjar/tax_calculator_spec.rb b/spec/super_good/solidus_taxjar/tax_calculator_spec.rb index aaa4ce1..ee4fee0 100644 --- a/spec/super_good/solidus_taxjar/tax_calculator_spec.rb +++ b/spec/super_good/solidus_taxjar/tax_calculator_spec.rb @@ -93,6 +93,16 @@ RSpec.describe ::SuperGood::SolidusTaxJar::TaxCalculator do end end + context "when the order has no tax address" do + let(:address) { nil } + + it "returns no taxes" do + expect(subject.order_id).to eq order.id + expect(subject.shipment_taxes).to be_empty + expect(subject.line_item_taxes).to be_empty + end + end + context "when the order has no line items" do let(:address) do ::Spree::Address.new( |