diff options
author | Chris Todorov <chris@super.gd> | 2021-03-15 14:57:05 -0700 |
---|---|---|
committer | Chris Todorov <chris@super.gd> | 2021-03-18 00:49:57 -0700 |
commit | cbc9db074cad3de73e6cbc8482cc34c66b022ef5 (patch) | |
tree | 4881e67ffbaf9d56a8e76835df3a6a2e7ce93f20 | |
parent | 644ea96100790569379cb1b429039df71d6b62b3 (diff) |
Add pending failing spec for address params
This change adds a failing spec which exposes a typo in our API params
helper method. In the next change we'll fix the issue and un-pend the
spec.
-rw-r--r-- | spec/super_good/solidus_taxjar/api_params_spec.rb | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/spec/super_good/solidus_taxjar/api_params_spec.rb b/spec/super_good/solidus_taxjar/api_params_spec.rb index 0fc54f6..a86b7c6 100644 --- a/spec/super_good/solidus_taxjar/api_params_spec.rb +++ b/spec/super_good/solidus_taxjar/api_params_spec.rb @@ -362,5 +362,42 @@ RSpec.describe SuperGood::SolidusTaxjar::ApiParams do street: "475 N Beverly Dr" }) end + + context "with an address without a state" do + let(:ship_address) do + Spree::Address.create!( + address1: "72 High St", + city: "Birmingham", + country: country_uk, + first_name: "Chuck", + last_name: "Schuldiner", + phone: "1-250-555-4444", + state_name: "West Midlands", + zipcode: "B4 7TA" + ) + end + + let(:country_uk) do + Spree::Country.create!( + iso3: "GBR", + iso: "GB", + iso_name: "UNITED KINGDOM", + name: "United Kingdom", + numcode: 826, + states_required: false + ) + end + + it "uses the state_name to build address params" do + pending("fix for state name fallback") + expect(subject).to eq({ + country: "GB", + state: "West Midlands", + zip: "B4 7TA", + city: "Birmingham", + street: "72 High St" + }) + end + end end end |