summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorandrea longhi <andrea@spaghetticode.it>2020-01-13 20:12:43 +0100
committerandrea longhi <andrea@spaghetticode.it>2020-01-14 09:44:59 +0100
commit134be24f677be142b5ddeb889c45e80a19fd58c8 (patch)
tree93679f3d992e96fb9a02f10e4c5b1c5df655a4b8 /spec
parent0c11683822428495635e5acd2ec32c382f2ff261 (diff)
Add SolidusTaxJar::APIParams.tax_rate_address_params
This helper converts a `Spree::Address` to address params that can be used to retrieve the tax rate for that location.
Diffstat (limited to 'spec')
-rw-r--r--spec/super_good/solidus_taxjar/api_params_spec.rb18
1 files changed, 18 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 3a55655..e0a8766 100644
--- a/spec/super_good/solidus_taxjar/api_params_spec.rb
+++ b/spec/super_good/solidus_taxjar/api_params_spec.rb
@@ -183,6 +183,24 @@ RSpec.describe SuperGood::SolidusTaxJar::APIParams do
end
end
+ describe "#tax_rate_address_params" do
+ subject { described_class.tax_rate_address_params(ship_address) }
+
+ it "returns params for fetching the tax rate for that address" do
+ expect(subject).to eq(
+ {
+ amount: 100,
+ shipping: 0,
+ to_city: "Los Angeles",
+ to_country: "US",
+ to_state: "CA",
+ to_street: "475 N Beverly Dr",
+ to_zip: "90210"
+ }
+ )
+ end
+ end
+
describe "#transaction_params" do
subject { described_class.transaction_params(order) }