summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorJared Norman <jared@super.gd>2019-06-25 11:49:55 -0700
committerJared Norman <jared@super.gd>2019-06-25 11:49:55 -0700
commit482438819ceb12499fe75f8b11fe4c505b32816f (patch)
tree4d8c443b35d4b935baeebf406765933a9fda14b6 /spec
parenta3272ab16bf1597949fd300cf60743ffe172081f (diff)
Make cache key a string
Diffstat (limited to 'spec')
-rw-r--r--spec/super_good/solidus_taxjar_spec.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/super_good/solidus_taxjar_spec.rb b/spec/super_good/solidus_taxjar_spec.rb
index efc38b0..2b04e7b 100644
--- a/spec/super_good/solidus_taxjar_spec.rb
+++ b/spec/super_good/solidus_taxjar_spec.rb
@@ -6,6 +6,21 @@ RSpec.describe SuperGood::SolidusTaxJar do
end
describe "configuration" do
+ describe ".cache_key" do
+ subject { described_class.cache_key.(order) }
+
+ let(:order) { Spree::Order.new }
+
+ it "returns the API params converted to JSON" do
+ allow(SuperGood::SolidusTaxJar::APIParams)
+ .to receive(:order_params)
+ .with(order)
+ .and_return({ some: "hash", with: "stuff", in: "it" })
+
+ expect(subject).to eq '{"some":"hash","with":"stuff","in":"it"}'
+ end
+ end
+
describe ".discount_calculator" do
subject { described_class.discount_calculator }
it { is_expected.to eq SuperGood::SolidusTaxJar::DiscountCalculator }