diff options
Diffstat (limited to 'spec')
-rw-r--r-- | spec/super_good/solidus_taxjar_spec.rb | 15 |
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 } |