diff options
author | Jared Norman <jared@super.gd> | 2019-01-09 16:41:35 -0800 |
---|---|---|
committer | Jared Norman <jared@super.gd> | 2019-01-09 16:41:35 -0800 |
commit | eba00b96eb98b714ac3401b951ba50778741a34f (patch) | |
tree | d6a1576009da88237c2279652445ad9cc7a82bfa /spec | |
parent | b1d9f590860a74831d594dec5464b67f3aa6e18f (diff) |
Fix spec issues
Because I hadn't set up database cleaner, there was some junk in my
local test database that was causing tests to pass.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/super_good/solidus_taxjar/api_spec.rb | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/spec/super_good/solidus_taxjar/api_spec.rb b/spec/super_good/solidus_taxjar/api_spec.rb index ce49dd3..cd455dc 100644 --- a/spec/super_good/solidus_taxjar/api_spec.rb +++ b/spec/super_good/solidus_taxjar/api_spec.rb @@ -16,11 +16,21 @@ RSpec.describe SuperGood::SolidusTaxJar::API do Spree::Order.create!( item_total: 28.00, shipment_total: 3.01, + store: store, ship_address: ship_address, line_items: [line_item] ) end + let(:store) do + Spree::Store.create!( + name: "Default Store", + url: "https://store.example.com", + code: "store", + mail_from_address: "contact@example.com" + ) + end + let(:ship_address) do Spree::Address.create!( country: country_us, @@ -74,7 +84,7 @@ RSpec.describe SuperGood::SolidusTaxJar::API do Spree::Product.create!( name: "Product Name", shipping_category: shipping_category, - tax_category: Spree::TaxCategory.first, + tax_category: tax_category, master: master_variant, variants: [master_variant] ) @@ -84,6 +94,14 @@ RSpec.describe SuperGood::SolidusTaxJar::API do Spree::ShippingCategory.create!(name: "Default Category") end + let(:tax_category) do + Spree::TaxCategory.create!( + name: "Default", + is_default: true, + tax_code: "A_GEN_TAX" + ) + end + let(:master_variant) do Spree::Variant.new( is_master: true, @@ -92,7 +110,6 @@ RSpec.describe SuperGood::SolidusTaxJar::API do end before do - allow(dummy_client).to receive(:tax_for_order).with( to_country: "US", to_zip: "90210", |