summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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