diff options
author | Adnan Abdulally <adnan.abdulally@printivity.com> | 2021-01-29 10:24:19 -0800 |
---|---|---|
committer | Noah Silvera <noah@super.gd> | 2021-03-17 07:11:08 -0700 |
commit | 51ff05c3de3500fdc6aee55e2919646028055286 (patch) | |
tree | 8709c1a8a6ea3bb361b52bd50c20dbe3c959c323 /spec/super_good | |
parent | 6fe0283f541a7a2a8c4940f4ce3626e754a292d9 (diff) |
Rename module SolidusTaxJar to SolidusTaxjar
In order for the Zeitwerk loader to properly identity our classes
from the file names, we should remove camel casing from this name
that isn't consistent with underscores in the file name itself.
Co-authored-by: Nick Van Doorn <nick@super.gd>
Diffstat (limited to 'spec/super_good')
7 files changed, 38 insertions, 38 deletions
diff --git a/spec/super_good/solidus_taxjar/addresses_spec.rb b/spec/super_good/solidus_taxjar/addresses_spec.rb index 9a149b8..b62de7b 100644 --- a/spec/super_good/solidus_taxjar/addresses_spec.rb +++ b/spec/super_good/solidus_taxjar/addresses_spec.rb @@ -1,6 +1,6 @@ require "spec_helper" -RSpec.describe SuperGood::SolidusTaxJar::Addresses do +RSpec.describe SuperGood::SolidusTaxjar::Addresses do describe "#normalize" do subject { described_class.new(api: dummy_api).normalize(spree_address) } @@ -38,7 +38,7 @@ RSpec.describe SuperGood::SolidusTaxJar::Addresses do } let(:dummy_api) { - instance_double ::SuperGood::SolidusTaxJar::API + instance_double ::SuperGood::SolidusTaxjar::API } context "when there are no possibilities for the address" do @@ -171,7 +171,7 @@ RSpec.describe SuperGood::SolidusTaxJar::Addresses do } let(:dummy_api) { - instance_double ::SuperGood::SolidusTaxJar::API + instance_double ::SuperGood::SolidusTaxjar::API } context "when there are no possibilities for the address" do diff --git a/spec/super_good/solidus_taxjar/api_params_spec.rb b/spec/super_good/solidus_taxjar/api_params_spec.rb index c4e3681..4c729e6 100644 --- a/spec/super_good/solidus_taxjar/api_params_spec.rb +++ b/spec/super_good/solidus_taxjar/api_params_spec.rb @@ -1,6 +1,6 @@ require "spec_helper" -RSpec.describe SuperGood::SolidusTaxJar::APIParams do +RSpec.describe SuperGood::SolidusTaxjar::APIParams do let(:order) do Spree::Order.create!( additional_tax_total: BigDecimal("9.87"), @@ -143,8 +143,8 @@ RSpec.describe SuperGood::SolidusTaxJar::APIParams do context "when custom params are used" do around do |example| - default = SuperGood::SolidusTaxJar.custom_order_params - SuperGood::SolidusTaxJar.custom_order_params = ->(order) { + default = SuperGood::SolidusTaxjar.custom_order_params + SuperGood::SolidusTaxjar.custom_order_params = ->(order) { { nexus_addresses: [ { @@ -158,7 +158,7 @@ RSpec.describe SuperGood::SolidusTaxJar::APIParams do } } example.run - SuperGood::SolidusTaxJar.custom_order_params = default + SuperGood::SolidusTaxjar.custom_order_params = default end it "returns params for fetching the tax for the order" do diff --git a/spec/super_good/solidus_taxjar/api_spec.rb b/spec/super_good/solidus_taxjar/api_spec.rb index ed97df0..189ff17 100644 --- a/spec/super_good/solidus_taxjar/api_spec.rb +++ b/spec/super_good/solidus_taxjar/api_spec.rb @@ -1,6 +1,6 @@ require "spec_helper" -RSpec.describe SuperGood::SolidusTaxJar::API do +RSpec.describe SuperGood::SolidusTaxjar::API do describe ".new" do subject { described_class.new } @@ -27,7 +27,7 @@ RSpec.describe SuperGood::SolidusTaxJar::API do let(:order) { Spree::Order.new } before do - allow(SuperGood::SolidusTaxJar::APIParams) + allow(SuperGood::SolidusTaxjar::APIParams) .to receive(:order_params) .with(order) .and_return({order: "params"}) @@ -51,7 +51,7 @@ RSpec.describe SuperGood::SolidusTaxJar::API do let(:response) { double(rate: tax_rate) } before do - allow(SuperGood::SolidusTaxJar::APIParams) + allow(SuperGood::SolidusTaxjar::APIParams) .to receive(:tax_rate_address_params) .with(address) .and_return({address: "params"}) @@ -73,7 +73,7 @@ RSpec.describe SuperGood::SolidusTaxJar::API do let(:address) { Spree::Address.new } before do - allow(SuperGood::SolidusTaxJar::APIParams) + allow(SuperGood::SolidusTaxjar::APIParams) .to receive(:address_params) .with(address) .and_return(["zipcode", {address: "params"}]) @@ -95,7 +95,7 @@ RSpec.describe SuperGood::SolidusTaxJar::API do let(:order) { Spree::Order.new } before do - allow(SuperGood::SolidusTaxJar::APIParams) + allow(SuperGood::SolidusTaxjar::APIParams) .to receive(:transaction_params) .with(order) .and_return({transaction: "params"}) @@ -117,7 +117,7 @@ RSpec.describe SuperGood::SolidusTaxJar::API do let(:order) { Spree::Order.new } before do - allow(SuperGood::SolidusTaxJar::APIParams) + allow(SuperGood::SolidusTaxjar::APIParams) .to receive(:transaction_params) .with(order) .and_return({transaction: "params"}) @@ -156,7 +156,7 @@ RSpec.describe SuperGood::SolidusTaxJar::API do let(:reimbursement) { Spree::Reimbursement.new } before do - allow(SuperGood::SolidusTaxJar::APIParams) + allow(SuperGood::SolidusTaxjar::APIParams) .to receive(:refund_params) .with(reimbursement) .and_return({refund: "params"}) @@ -178,7 +178,7 @@ RSpec.describe SuperGood::SolidusTaxJar::API do let(:spree_address) { build :address } before do - allow(SuperGood::SolidusTaxJar::APIParams) + allow(SuperGood::SolidusTaxjar::APIParams) .to receive(:validate_address_params) .with(spree_address) .and_return({address: "params"}) diff --git a/spec/super_good/solidus_taxjar/discount_calculator_spec.rb b/spec/super_good/solidus_taxjar/discount_calculator_spec.rb index 65f3bc4..d628c4f 100644 --- a/spec/super_good/solidus_taxjar/discount_calculator_spec.rb +++ b/spec/super_good/solidus_taxjar/discount_calculator_spec.rb @@ -1,6 +1,6 @@ require "spec_helper" -RSpec.describe SuperGood::SolidusTaxJar::DiscountCalculator do +RSpec.describe SuperGood::SolidusTaxjar::DiscountCalculator do describe "#discount" do subject { calculator.discount } diff --git a/spec/super_good/solidus_taxjar/tax_calculator_spec.rb b/spec/super_good/solidus_taxjar/tax_calculator_spec.rb index c88be44..7609a83 100644 --- a/spec/super_good/solidus_taxjar/tax_calculator_spec.rb +++ b/spec/super_good/solidus_taxjar/tax_calculator_spec.rb @@ -1,13 +1,13 @@ require "spec_helper" -RSpec.describe ::SuperGood::SolidusTaxJar::TaxCalculator do +RSpec.describe ::SuperGood::SolidusTaxjar::TaxCalculator do describe "#calculate" do subject { calculator.calculate } let(:calculator) { described_class.new(order, api: dummy_api) } let(:dummy_api) do - instance_double ::SuperGood::SolidusTaxJar::API + instance_double ::SuperGood::SolidusTaxjar::API end let(:order) do @@ -141,7 +141,7 @@ RSpec.describe ::SuperGood::SolidusTaxJar::TaxCalculator do end it "calls the configured error handler" do - expect(SuperGood::SolidusTaxJar.exception_handler).to receive(:call) do |e| + expect(SuperGood::SolidusTaxjar.exception_handler).to receive(:call) do |e| expect(e).to be_a StandardError expect(e.message).to eq "A bad thing happened." end @@ -217,7 +217,7 @@ RSpec.describe ::SuperGood::SolidusTaxJar::TaxCalculator do context "with custom line item tax labels" do before do - allow(SuperGood::SolidusTaxJar.line_item_tax_label_maker) + allow(SuperGood::SolidusTaxjar.line_item_tax_label_maker) .to receive(:call) .with(taxjar_line_item, line_items.first) .and_return("Space Tax") @@ -231,7 +231,7 @@ RSpec.describe ::SuperGood::SolidusTaxJar::TaxCalculator do context "but the taxable address check returns false" do before do - allow(SuperGood::SolidusTaxJar.taxable_address_check) + allow(SuperGood::SolidusTaxjar.taxable_address_check) .to receive(:call).with(address) .and_return(false) end @@ -245,7 +245,7 @@ RSpec.describe ::SuperGood::SolidusTaxJar::TaxCalculator do context "but the taxable order check returns false" do before do - allow(SuperGood::SolidusTaxJar.taxable_order_check) + allow(SuperGood::SolidusTaxjar.taxable_order_check) .to receive(:call).with(order) .and_return(false) end @@ -289,7 +289,7 @@ RSpec.describe ::SuperGood::SolidusTaxJar::TaxCalculator do context "with custom shipping tax labels" do before do - allow(SuperGood::SolidusTaxJar.shipping_tax_label_maker).to receive(:call) + allow(SuperGood::SolidusTaxjar.shipping_tax_label_maker).to receive(:call) .and_return("Magic Tax", "Spicy Tax", "Vegetable Tax") end @@ -307,8 +307,8 @@ RSpec.describe ::SuperGood::SolidusTaxJar::TaxCalculator do end context "when test_mode is set" do - before { SuperGood::SolidusTaxJar.test_mode = true } - after { SuperGood::SolidusTaxJar.test_mode = false } + before { SuperGood::SolidusTaxjar.test_mode = true } + after { SuperGood::SolidusTaxjar.test_mode = false } it "returns no taxes" do expect(subject.order_id).to eq order.id diff --git a/spec/super_good/solidus_taxjar/tax_rate_calculator_spec.rb b/spec/super_good/solidus_taxjar/tax_rate_calculator_spec.rb index 057d58d..de7eb26 100644 --- a/spec/super_good/solidus_taxjar/tax_rate_calculator_spec.rb +++ b/spec/super_good/solidus_taxjar/tax_rate_calculator_spec.rb @@ -1,13 +1,13 @@ require "spec_helper" -RSpec.describe ::SuperGood::SolidusTaxJar::TaxRateCalculator do +RSpec.describe ::SuperGood::SolidusTaxjar::TaxRateCalculator do describe "#calculate" do subject { calculator.calculate } let(:calculator) { described_class.new(address, api: dummy_api) } let(:dummy_api) do - instance_double ::SuperGood::SolidusTaxJar::API + instance_double ::SuperGood::SolidusTaxjar::API end let(:dummy_tax_rate) { BigDecimal(0) } @@ -43,10 +43,10 @@ RSpec.describe ::SuperGood::SolidusTaxJar::TaxRateCalculator do context "when we're not rescuing from errors" do around do |example| - handler = SuperGood::SolidusTaxJar.exception_handler - SuperGood::SolidusTaxJar.exception_handler = ->(error) { raise error } + handler = SuperGood::SolidusTaxjar.exception_handler + SuperGood::SolidusTaxjar.exception_handler = ->(error) { raise error } example.run - SuperGood::SolidusTaxJar.exception_handler = handler + SuperGood::SolidusTaxjar.exception_handler = handler end it_behaves_like "returns the dummy tax rate" @@ -64,7 +64,7 @@ RSpec.describe ::SuperGood::SolidusTaxJar::TaxRateCalculator do context "when the address is not taxable" do before do - allow(SuperGood::SolidusTaxJar.taxable_address_check) + allow(SuperGood::SolidusTaxjar.taxable_address_check) .to receive(:call).with(address) .and_return(false) end @@ -93,7 +93,7 @@ RSpec.describe ::SuperGood::SolidusTaxJar::TaxRateCalculator do end it "calls the configured error handler" do - expect(SuperGood::SolidusTaxJar.exception_handler).to receive(:call) do |e| + expect(SuperGood::SolidusTaxjar.exception_handler).to receive(:call) do |e| expect(e).to be_a StandardError expect(e.message).to eq "A bad thing happened." end @@ -107,8 +107,8 @@ RSpec.describe ::SuperGood::SolidusTaxJar::TaxRateCalculator do context "when test_mode is set" do let(:address) { complete_address } - before { SuperGood::SolidusTaxJar.test_mode = true } - after { SuperGood::SolidusTaxJar.test_mode = false } + before { SuperGood::SolidusTaxjar.test_mode = true } + after { SuperGood::SolidusTaxjar.test_mode = false } it_behaves_like "returns the dummy tax rate" end diff --git a/spec/super_good/solidus_taxjar_spec.rb b/spec/super_good/solidus_taxjar_spec.rb index 30a2d01..865ed8b 100644 --- a/spec/super_good/solidus_taxjar_spec.rb +++ b/spec/super_good/solidus_taxjar_spec.rb @@ -1,8 +1,8 @@ require "spec_helper" -RSpec.describe SuperGood::SolidusTaxJar do +RSpec.describe SuperGood::SolidusTaxjar do it "has a version number" do - expect(SuperGood::SolidusTaxJar::VERSION).not_to be nil + expect(SuperGood::SolidusTaxjar::VERSION).not_to be nil end describe "configuration" do @@ -12,7 +12,7 @@ RSpec.describe SuperGood::SolidusTaxJar do let(:order) { Spree::Order.new } it "returns the API params converted to JSON" do - allow(SuperGood::SolidusTaxJar::APIParams) + allow(SuperGood::SolidusTaxjar::APIParams) .to receive(:order_params) .with(order) .and_return({some: "hash", with: "stuff", in: "it"}) @@ -23,7 +23,7 @@ RSpec.describe SuperGood::SolidusTaxJar do describe ".discount_calculator" do subject { described_class.discount_calculator } - it { is_expected.to eq SuperGood::SolidusTaxJar::DiscountCalculator } + it { is_expected.to eq SuperGood::SolidusTaxjar::DiscountCalculator } end describe ".test_mode" do |