diff options
author | Jared Norman <jared@super.gd> | 2019-03-14 11:12:37 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-14 11:12:37 -0700 |
commit | 945490776a137821df70111c32127ffc85b4c90b (patch) | |
tree | e6f6cbeccca0acb40fdef753368a255ca67e6b32 /spec | |
parent | e7682d6cd682bcff06c3a313fa0086abfc607f96 (diff) | |
parent | 828350fd2b1cab40bc05e4e47d4b20f9a8542b1f (diff) |
Merge pull request #2 from JuanCrg90/bug/add-taxlocation-guard
Add guard clause for TaxLocation addresses
Diffstat (limited to 'spec')
-rw-r--r-- | spec/super_good/solidus_taxjar/tax_calculator_spec.rb | 19 |
1 files changed, 19 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 0d390ec..aaa4ce1 100644 --- a/spec/super_good/solidus_taxjar/tax_calculator_spec.rb +++ b/spec/super_good/solidus_taxjar/tax_calculator_spec.rb @@ -74,6 +74,25 @@ RSpec.describe ::SuperGood::SolidusTaxJar::TaxCalculator do end end + context "when the order has an incomplete tax address" do + let(:address) do + ::Spree::Address.new( + first_name: "Ronnie James", + zipcode: nil, + address1: nil, + city: "Beverly Hills", + state_name: "California", + country: ::Spree::Country.new(iso: "US") + ) + end + + 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( |