summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoah Silvera <noah@super.gd>2021-03-26 10:08:42 -0700
committerGitHub <noreply@github.com>2021-03-26 10:08:42 -0700
commita6a14adce724f7c32f078c26138ad9cfd4dc4c70 (patch)
tree0801c710eac6ebbdbd93d5a95a618589a9a60c63
parent7ed6f05c68e51369407b0d2fdb54b9f7fd298483 (diff)
parente3bbd1d8d1da565cf204d7ab758056897465bf06 (diff)
Merge pull request #51 from nvandoorn/add-taxjar-nexus-api-call
Add TaxJar `nexus_regions` API call
-rw-r--r--CHANGELOG.md6
-rw-r--r--lib/super_good/solidus_taxjar/api.rb4
-rw-r--r--spec/super_good/solidus_taxjar/api_spec.rb15
3 files changed, 23 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 58a1c46..d953efa 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,14 +2,16 @@
## master
-## v0.18.1
+- [#51](https://github.com/SuperGoodSoft/solidus_taxjar/pull/51) Add nexus regions method to API
+
+## v0.18.1
[#52](https://github.com/supergoodsoft/solidus_taxjar/pull/52) fixes a critical bug in the API class that was released in `v0.18.0`. Please upgrade.
- [#47](https://github.com/SuperGoodSoft/solidus_taxjar/pull/47) Fixed bug in `validate_address_params` for addresses without a state
- [#52](https://github.com/supergoodsoft/solidus_taxjar/pull/52) Fixed critical bug in API class
-## ~~v0.18.0~~
+## ~~v0.18.0~~
`v0.18.0` was removed due to a regression in the API class that was fixed in [#52](https://github.com/SuperGoodSoft/solidus_taxjar/pull/52) and `v0.18.1`
- [#21](https://github.com/SuperGoodSoft/solidus_taxjar/pull/21) Migrated project to `solidus_dev_support`
diff --git a/lib/super_good/solidus_taxjar/api.rb b/lib/super_good/solidus_taxjar/api.rb
index 096994b..715eb5c 100644
--- a/lib/super_good/solidus_taxjar/api.rb
+++ b/lib/super_good/solidus_taxjar/api.rb
@@ -55,6 +55,10 @@ module SuperGood
taxjar_client.validate_address ApiParams.validate_address_params(spree_address)
end
+ def nexus_regions
+ taxjar_client.nexus_regions
+ end
+
private
attr_reader :taxjar_client
diff --git a/spec/super_good/solidus_taxjar/api_spec.rb b/spec/super_good/solidus_taxjar/api_spec.rb
index 94f214d..df46a11 100644
--- a/spec/super_good/solidus_taxjar/api_spec.rb
+++ b/spec/super_good/solidus_taxjar/api_spec.rb
@@ -202,4 +202,19 @@ RSpec.describe SuperGood::SolidusTaxjar::Api do
it { is_expected.to eq({some_kind_of: "response"}) }
end
+
+ describe "#nexus_regions" do
+ subject { api.nexus_regions }
+
+ let(:api) { described_class.new(taxjar_client: dummy_client) }
+ let(:dummy_client) { instance_double ::Taxjar::Client }
+
+ before do
+ allow(dummy_client)
+ .to receive(:nexus_regions)
+ .and_return({some_kind_of: "response"})
+ end
+
+ it { is_expected.to eq({some_kind_of: "response"}) }
+ end
end