From cbc9db074cad3de73e6cbc8482cc34c66b022ef5 Mon Sep 17 00:00:00 2001 From: Chris Todorov Date: Mon, 15 Mar 2021 14:57:05 -0700 Subject: 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. --- spec/super_good/solidus_taxjar/api_params_spec.rb | 37 +++++++++++++++++++++++ 1 file changed, 37 insertions(+) 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 -- cgit v1.2.3