diff --git a/core/spec/support/dummy_ability.rb b/core/lib/spree/testing_support/dummy_ability.rb similarity index 100% rename from core/spec/support/dummy_ability.rb rename to core/lib/spree/testing_support/dummy_ability.rb diff --git a/core/spec/shared_examples/calculator_shared_examples.rb b/core/lib/spree/testing_support/shared_examples/calculator.rb similarity index 100% rename from core/spec/shared_examples/calculator_shared_examples.rb rename to core/lib/spree/testing_support/shared_examples/calculator.rb diff --git a/core/lib/spree/testing_support/shared_examples/order_factory.rb b/core/lib/spree/testing_support/shared_examples/order_factory.rb new file mode 100644 index 00000000000..8c647544e47 --- /dev/null +++ b/core/lib/spree/testing_support/shared_examples/order_factory.rb @@ -0,0 +1,141 @@ +# frozen_string_literal: true + +RSpec.shared_examples "shipping methods are assigned" do + context "given a shipping method" do + let(:shipping_method) { create(:shipping_method) } + + it "assigns the shipping method when created" do + expect( + create( + factory, + shipping_method: shipping_method + ).shipments.map(&:shipping_method) + ).to all(eq(shipping_method)) + end + + it "assigns the shipping method when built" do + expect( + build( + factory, + shipping_method: shipping_method + ).shipments.map(&:shipping_method) + ).to all(eq(shipping_method)) + end + end +end + +RSpec.shared_examples "an order with line items factory" do |expected_order_state, expected_inventory_unit_state| + # This factory cannot be built correctly because Shipment#set_up_inventory + # requires records to be saved. + context "when created" do + let(:stock_location) { create(:stock_location) } + let(:first_variant) { create(:variant) } + let(:second_variant) { create(:variant) } + let(:shipping_method) { create(:shipping_method) } + let(:order) do + create( + factory, + stock_location: stock_location, + line_items_attributes: [ + { variant: first_variant, quantity: 1, price: 1 }, + { variant: second_variant, quantity: 2, price: 2 } + ], + shipment_cost: 3, + shipping_method: shipping_method + ) + end + + it "has the expected attributes" do + aggregate_failures "for line items" do + expect(order.line_items.count).to eq 2 + expect(order.line_items[0]).to have_attributes( + quantity: 1, + price: 1.0 + ) + expect(order.line_items[1]).to have_attributes( + price: 2.0, + quantity: 2 + ) + end + + aggregate_failures "for shipments" do + expect(order.shipments.count).to eq 1 + expect(order.shipments[0]).to have_attributes( + amount: 3.0, + stock_location: stock_location + ) + + expect(order.shipments[0].shipping_method).to eq(shipping_method) + + # Explicitly order by line item id, because otherwise these can be in + # an arbitrary order. + inventory_units = order.shipments[0].inventory_units.sort_by(&:line_item_id) + + expect(inventory_units.count).to eq(3) + expect(inventory_units[0]).to have_attributes( + order: order, + shipment: order.shipments[0], + line_item: order.line_items[0], + variant: order.line_items[0].variant, + state: expected_inventory_unit_state + ) + expect(inventory_units[1]).to have_attributes( + order: order, + shipment: order.shipments[0], + line_item: order.line_items[1], + variant: order.line_items[1].variant, + state: expected_inventory_unit_state + ) + expect(inventory_units[2]).to have_attributes( + order: order, + shipment: order.shipments[0], + line_item: order.line_items[1], + variant: order.line_items[1].variant, + state: expected_inventory_unit_state + ) + end + + expect(order).to have_attributes( + item_total: 5.0, + ship_total: 3.0, + total: 8.0, + state: expected_order_state + ) + end + end + + context 'when shipments should be taxed' do + let!(:ship_address) { create(:address) } + let!(:tax_zone) { create(:global_zone) } # will include the above address + let!(:tax_rate) { create(:tax_rate, amount: 0.10, zone: tax_zone, tax_categories: [tax_category]) } + + let(:tax_category) { create(:tax_category) } + let(:shipping_method) { create(:shipping_method, tax_category: tax_category, zones: [tax_zone]) } + + it 'shipments get a tax adjustment' do + order = create(factory, ship_address: ship_address, shipping_method: shipping_method) + shipment = order.shipments[0] + + expect(shipment.additional_tax_total).to be > 0 + end + end +end + +RSpec.shared_examples 'supplied completed_at is respected' do + context 'when passed a completed_at timestamp' do + let(:completed_at) { 2.days.ago } + let(:order) { create(factory, completed_at: completed_at) } + + it 'respects the timestamp' do + expect(order.completed_at).to be_within(5.seconds).of(completed_at) + end + end + + context 'when no completed_at timestamp is passed' do + let(:order) { create(factory) } + + it 'defaults to the current time' do + expect(order.completed_at).to be_within(2.seconds).of(Time.current) + end + end +end diff --git a/core/spec/support/concerns/working_factories.rb b/core/lib/spree/testing_support/shared_examples/working_factory.rb similarity index 100% rename from core/spec/support/concerns/working_factories.rb rename to core/lib/spree/testing_support/shared_examples/working_factory.rb diff --git a/core/spec/lib/spree/core/role_configuration_spec.rb b/core/spec/lib/spree/core/role_configuration_spec.rb index 2fbf8665065..cf3e5da3802 100644 --- a/core/spec/lib/spree/core/role_configuration_spec.rb +++ b/core/spec/lib/spree/core/role_configuration_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/dummy_ability' RSpec.describe Spree::RoleConfiguration do class DummyPermissionSet < Spree::PermissionSets::Base diff --git a/core/spec/lib/spree/core/testing_support/factories/address_factory_spec.rb b/core/spec/lib/spree/core/testing_support/factories/address_factory_spec.rb index f5a0d93a429..5530f8cbcb5 100644 --- a/core/spec/lib/spree/core/testing_support/factories/address_factory_spec.rb +++ b/core/spec/lib/spree/core/testing_support/factories/address_factory_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/shared_examples/working_factory' RSpec.describe 'address factory' do let(:factory_class) { Spree::Address } diff --git a/core/spec/lib/spree/core/testing_support/factories/adjustment_factory_spec.rb b/core/spec/lib/spree/core/testing_support/factories/adjustment_factory_spec.rb index 18f35e114a8..3a1a0992481 100644 --- a/core/spec/lib/spree/core/testing_support/factories/adjustment_factory_spec.rb +++ b/core/spec/lib/spree/core/testing_support/factories/adjustment_factory_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/shared_examples/working_factory' RSpec.describe 'adjustment factory' do let(:factory_class) { Spree::Adjustment } diff --git a/core/spec/lib/spree/core/testing_support/factories/adjustment_reason_factory_spec.rb b/core/spec/lib/spree/core/testing_support/factories/adjustment_reason_factory_spec.rb index 22680aef0d2..50964b3c7f8 100644 --- a/core/spec/lib/spree/core/testing_support/factories/adjustment_reason_factory_spec.rb +++ b/core/spec/lib/spree/core/testing_support/factories/adjustment_reason_factory_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/shared_examples/working_factory' RSpec.describe 'adjustment reason factory' do let(:factory_class) { Spree::AdjustmentReason } diff --git a/core/spec/lib/spree/core/testing_support/factories/calculator_factory_spec.rb b/core/spec/lib/spree/core/testing_support/factories/calculator_factory_spec.rb index 8099edb0d03..7efaa94dc24 100644 --- a/core/spec/lib/spree/core/testing_support/factories/calculator_factory_spec.rb +++ b/core/spec/lib/spree/core/testing_support/factories/calculator_factory_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/shared_examples/working_factory' RSpec.describe 'calculator factory' do let(:factory_class) { Spree::Calculator } diff --git a/core/spec/lib/spree/core/testing_support/factories/carton_factory_spec.rb b/core/spec/lib/spree/core/testing_support/factories/carton_factory_spec.rb index 53ef5125ee9..95800abf294 100644 --- a/core/spec/lib/spree/core/testing_support/factories/carton_factory_spec.rb +++ b/core/spec/lib/spree/core/testing_support/factories/carton_factory_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/shared_examples/working_factory' RSpec.describe 'carton factory' do let(:factory_class) { Spree::Carton } diff --git a/core/spec/lib/spree/core/testing_support/factories/country_factory_spec.rb b/core/spec/lib/spree/core/testing_support/factories/country_factory_spec.rb index aabfb20c43f..7e92e44e592 100644 --- a/core/spec/lib/spree/core/testing_support/factories/country_factory_spec.rb +++ b/core/spec/lib/spree/core/testing_support/factories/country_factory_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/shared_examples/working_factory' RSpec.describe 'country factory' do let(:factory_class) { Spree::Country } diff --git a/core/spec/lib/spree/core/testing_support/factories/credit_card_factory_spec.rb b/core/spec/lib/spree/core/testing_support/factories/credit_card_factory_spec.rb index f8acb76040b..9f888a9565e 100644 --- a/core/spec/lib/spree/core/testing_support/factories/credit_card_factory_spec.rb +++ b/core/spec/lib/spree/core/testing_support/factories/credit_card_factory_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/shared_examples/working_factory' RSpec.describe 'credit card factory' do let(:factory_class) { Spree::CreditCard } diff --git a/core/spec/lib/spree/core/testing_support/factories/customer_return_factory_spec.rb b/core/spec/lib/spree/core/testing_support/factories/customer_return_factory_spec.rb index c91f2a51594..e5270316d0d 100644 --- a/core/spec/lib/spree/core/testing_support/factories/customer_return_factory_spec.rb +++ b/core/spec/lib/spree/core/testing_support/factories/customer_return_factory_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/shared_examples/working_factory' RSpec.describe 'customer return factory' do let(:factory_class) { Spree::CustomerReturn } diff --git a/core/spec/lib/spree/core/testing_support/factories/image_factory_spec.rb b/core/spec/lib/spree/core/testing_support/factories/image_factory_spec.rb index d21cdc417b0..6eeac767d91 100644 --- a/core/spec/lib/spree/core/testing_support/factories/image_factory_spec.rb +++ b/core/spec/lib/spree/core/testing_support/factories/image_factory_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/shared_examples/working_factory' RSpec.describe 'image factory' do let(:factory_class) { Spree::Image } diff --git a/core/spec/lib/spree/core/testing_support/factories/inventory_unit_factory_spec.rb b/core/spec/lib/spree/core/testing_support/factories/inventory_unit_factory_spec.rb index db24a6d12fc..e86dbf190e3 100644 --- a/core/spec/lib/spree/core/testing_support/factories/inventory_unit_factory_spec.rb +++ b/core/spec/lib/spree/core/testing_support/factories/inventory_unit_factory_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/shared_examples/working_factory' RSpec.describe 'inventory unit factory' do let(:factory_class) { Spree::InventoryUnit } diff --git a/core/spec/lib/spree/core/testing_support/factories/line_item_factory_spec.rb b/core/spec/lib/spree/core/testing_support/factories/line_item_factory_spec.rb index f2883639c64..5d33112d999 100644 --- a/core/spec/lib/spree/core/testing_support/factories/line_item_factory_spec.rb +++ b/core/spec/lib/spree/core/testing_support/factories/line_item_factory_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/shared_examples/working_factory' RSpec.describe 'line item factory' do let(:factory_class) { Spree::LineItem } diff --git a/core/spec/lib/spree/core/testing_support/factories/option_type_factory_spec.rb b/core/spec/lib/spree/core/testing_support/factories/option_type_factory_spec.rb index 15ba10f9f9e..e0604bd2e01 100644 --- a/core/spec/lib/spree/core/testing_support/factories/option_type_factory_spec.rb +++ b/core/spec/lib/spree/core/testing_support/factories/option_type_factory_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/shared_examples/working_factory' RSpec.describe 'option type factory' do let(:factory_class) { Spree::OptionType } diff --git a/core/spec/lib/spree/core/testing_support/factories/option_value_factory_spec.rb b/core/spec/lib/spree/core/testing_support/factories/option_value_factory_spec.rb index 0f33cb32e61..a3d5d9a7f44 100644 --- a/core/spec/lib/spree/core/testing_support/factories/option_value_factory_spec.rb +++ b/core/spec/lib/spree/core/testing_support/factories/option_value_factory_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/shared_examples/working_factory' RSpec.describe 'option value factory' do let(:factory_class) { Spree::OptionValue } diff --git a/core/spec/lib/spree/core/testing_support/factories/order_factory_spec.rb b/core/spec/lib/spree/core/testing_support/factories/order_factory_spec.rb index 52b3f677924..b0190bc7f45 100644 --- a/core/spec/lib/spree/core/testing_support/factories/order_factory_spec.rb +++ b/core/spec/lib/spree/core/testing_support/factories/order_factory_spec.rb @@ -1,146 +1,8 @@ # frozen_string_literal: true require 'rails_helper' - -RSpec.shared_examples "shipping methods are assigned" do - context "given a shipping method" do - let(:shipping_method) { create(:shipping_method) } - - it "assigns the shipping method when created" do - expect( - create( - factory, - shipping_method: shipping_method - ).shipments.map(&:shipping_method) - ).to all(eq(shipping_method)) - end - - it "assigns the shipping method when built" do - expect( - build( - factory, - shipping_method: shipping_method - ).shipments.map(&:shipping_method) - ).to all(eq(shipping_method)) - end - end -end - -RSpec.shared_examples "an order with line items factory" do |expected_order_state, expected_inventory_unit_state| - # This factory cannot be built correctly because Shipment#set_up_inventory - # requires records to be saved. - context "when created" do - let(:stock_location) { create(:stock_location) } - let(:first_variant) { create(:variant) } - let(:second_variant) { create(:variant) } - let(:shipping_method) { create(:shipping_method) } - let(:order) do - create( - factory, - stock_location: stock_location, - line_items_attributes: [ - { variant: first_variant, quantity: 1, price: 1 }, - { variant: second_variant, quantity: 2, price: 2 } - ], - shipment_cost: 3, - shipping_method: shipping_method - ) - end - - it "has the expected attributes" do - aggregate_failures "for line items" do - expect(order.line_items.count).to eq 2 - expect(order.line_items[0]).to have_attributes( - quantity: 1, - price: 1.0 - ) - expect(order.line_items[1]).to have_attributes( - price: 2.0, - quantity: 2 - ) - end - - aggregate_failures "for shipments" do - expect(order.shipments.count).to eq 1 - expect(order.shipments[0]).to have_attributes( - amount: 3.0, - stock_location: stock_location - ) - - expect(order.shipments[0].shipping_method).to eq(shipping_method) - - # Explicitly order by line item id, because otherwise these can be in - # an arbitrary order. - inventory_units = order.shipments[0].inventory_units.sort_by(&:line_item_id) - - expect(inventory_units.count).to eq(3) - expect(inventory_units[0]).to have_attributes( - order: order, - shipment: order.shipments[0], - line_item: order.line_items[0], - variant: order.line_items[0].variant, - state: expected_inventory_unit_state - ) - expect(inventory_units[1]).to have_attributes( - order: order, - shipment: order.shipments[0], - line_item: order.line_items[1], - variant: order.line_items[1].variant, - state: expected_inventory_unit_state - ) - expect(inventory_units[2]).to have_attributes( - order: order, - shipment: order.shipments[0], - line_item: order.line_items[1], - variant: order.line_items[1].variant, - state: expected_inventory_unit_state - ) - end - - expect(order).to have_attributes( - item_total: 5.0, - ship_total: 3.0, - total: 8.0, - state: expected_order_state - ) - end - end - - context 'when shipments should be taxed' do - let!(:ship_address) { create(:address) } - let!(:tax_zone) { create(:global_zone) } # will include the above address - let!(:tax_rate) { create(:tax_rate, amount: 0.10, zone: tax_zone, tax_categories: [tax_category]) } - - let(:tax_category) { create(:tax_category) } - let(:shipping_method) { create(:shipping_method, tax_category: tax_category, zones: [tax_zone]) } - - it 'shipments get a tax adjustment' do - order = create(factory, ship_address: ship_address, shipping_method: shipping_method) - shipment = order.shipments[0] - - expect(shipment.additional_tax_total).to be > 0 - end - end -end - -RSpec.shared_examples 'supplied completed_at is respected' do - context 'when passed a completed_at timestamp' do - let(:completed_at) { 2.days.ago } - let(:order) { create(factory, completed_at: completed_at) } - - it 'respects the timestamp' do - expect(order.completed_at).to be_within(5.seconds).of(completed_at) - end - end - - context 'when no completed_at timestamp is passed' do - let(:order) { create(factory) } - - it 'defaults to the current time' do - expect(order.completed_at).to be_within(2.seconds).of(Time.current) - end - end -end +require 'spree/testing_support/shared_examples/working_factory' +require "spree/testing_support/shared_examples/order_factory" RSpec.describe 'order factory' do let(:factory_class) { Spree::Order } diff --git a/core/spec/lib/spree/core/testing_support/factories/order_promotion_factory_spec.rb b/core/spec/lib/spree/core/testing_support/factories/order_promotion_factory_spec.rb index 193f2abc6de..15cf1e891d8 100644 --- a/core/spec/lib/spree/core/testing_support/factories/order_promotion_factory_spec.rb +++ b/core/spec/lib/spree/core/testing_support/factories/order_promotion_factory_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/shared_examples/working_factory' RSpec.describe 'order promotion factory' do let(:factory_class) { Spree::OrderPromotion } diff --git a/core/spec/lib/spree/core/testing_support/factories/payment_factory_spec.rb b/core/spec/lib/spree/core/testing_support/factories/payment_factory_spec.rb index b89a863a9a1..cd8117a9b56 100644 --- a/core/spec/lib/spree/core/testing_support/factories/payment_factory_spec.rb +++ b/core/spec/lib/spree/core/testing_support/factories/payment_factory_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/shared_examples/working_factory' RSpec.describe 'payment factory' do let(:factory_class) { Spree::Payment } diff --git a/core/spec/lib/spree/core/testing_support/factories/payment_method_factory_spec.rb b/core/spec/lib/spree/core/testing_support/factories/payment_method_factory_spec.rb index ff008d55269..a4092addbd9 100644 --- a/core/spec/lib/spree/core/testing_support/factories/payment_method_factory_spec.rb +++ b/core/spec/lib/spree/core/testing_support/factories/payment_method_factory_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/shared_examples/working_factory' RSpec.describe 'payment method factory' do let(:factory_class) { Spree::PaymentMethod } diff --git a/core/spec/lib/spree/core/testing_support/factories/price_factory_spec.rb b/core/spec/lib/spree/core/testing_support/factories/price_factory_spec.rb index 77ea9a4248c..1726a5dae3d 100644 --- a/core/spec/lib/spree/core/testing_support/factories/price_factory_spec.rb +++ b/core/spec/lib/spree/core/testing_support/factories/price_factory_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/shared_examples/working_factory' RSpec.describe 'price factory' do let(:factory_class) { Spree::Price } diff --git a/core/spec/lib/spree/core/testing_support/factories/product_factory_spec.rb b/core/spec/lib/spree/core/testing_support/factories/product_factory_spec.rb index bcc906cba4e..bdb17b5317d 100644 --- a/core/spec/lib/spree/core/testing_support/factories/product_factory_spec.rb +++ b/core/spec/lib/spree/core/testing_support/factories/product_factory_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/shared_examples/working_factory' RSpec.describe 'product factory' do let(:factory_class) { Spree::Product } diff --git a/core/spec/lib/spree/core/testing_support/factories/product_option_type_factory_spec.rb b/core/spec/lib/spree/core/testing_support/factories/product_option_type_factory_spec.rb index f4ee28b24ca..0764dad61a9 100644 --- a/core/spec/lib/spree/core/testing_support/factories/product_option_type_factory_spec.rb +++ b/core/spec/lib/spree/core/testing_support/factories/product_option_type_factory_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/shared_examples/working_factory' RSpec.describe 'product option type factory' do let(:factory_class) { Spree::ProductOptionType } diff --git a/core/spec/lib/spree/core/testing_support/factories/product_property_factory_spec.rb b/core/spec/lib/spree/core/testing_support/factories/product_property_factory_spec.rb index 22e367c66cd..27e1c9c80b1 100644 --- a/core/spec/lib/spree/core/testing_support/factories/product_property_factory_spec.rb +++ b/core/spec/lib/spree/core/testing_support/factories/product_property_factory_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/shared_examples/working_factory' RSpec.describe 'product property factory' do let(:factory_class) { Spree::ProductProperty } diff --git a/core/spec/lib/spree/core/testing_support/factories/promotion_category_factory_spec.rb b/core/spec/lib/spree/core/testing_support/factories/promotion_category_factory_spec.rb index 906d149c092..6ce2c61bc7c 100644 --- a/core/spec/lib/spree/core/testing_support/factories/promotion_category_factory_spec.rb +++ b/core/spec/lib/spree/core/testing_support/factories/promotion_category_factory_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/shared_examples/working_factory' RSpec.describe 'promotion category factory' do let(:factory_class) { Spree::PromotionCategory } diff --git a/core/spec/lib/spree/core/testing_support/factories/promotion_code_factory_spec.rb b/core/spec/lib/spree/core/testing_support/factories/promotion_code_factory_spec.rb index 7b240596384..47bf6cb2c1d 100644 --- a/core/spec/lib/spree/core/testing_support/factories/promotion_code_factory_spec.rb +++ b/core/spec/lib/spree/core/testing_support/factories/promotion_code_factory_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/shared_examples/working_factory' RSpec.describe 'promotion code factory' do let(:factory_class) { Spree::PromotionCode } diff --git a/core/spec/lib/spree/core/testing_support/factories/promotion_factory_spec.rb b/core/spec/lib/spree/core/testing_support/factories/promotion_factory_spec.rb index efef29758df..2af76303cd5 100644 --- a/core/spec/lib/spree/core/testing_support/factories/promotion_factory_spec.rb +++ b/core/spec/lib/spree/core/testing_support/factories/promotion_factory_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/shared_examples/working_factory' RSpec.describe 'promotion code factory' do let(:factory_class) { Spree::Promotion } diff --git a/core/spec/lib/spree/core/testing_support/factories/property_factory_spec.rb b/core/spec/lib/spree/core/testing_support/factories/property_factory_spec.rb index 221cef9098e..199033409a2 100644 --- a/core/spec/lib/spree/core/testing_support/factories/property_factory_spec.rb +++ b/core/spec/lib/spree/core/testing_support/factories/property_factory_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/shared_examples/working_factory' RSpec.describe 'property factory' do let(:factory_class) { Spree::Property } diff --git a/core/spec/lib/spree/core/testing_support/factories/refund_factory_spec.rb b/core/spec/lib/spree/core/testing_support/factories/refund_factory_spec.rb index a7b707d777f..28a003a8223 100644 --- a/core/spec/lib/spree/core/testing_support/factories/refund_factory_spec.rb +++ b/core/spec/lib/spree/core/testing_support/factories/refund_factory_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/shared_examples/working_factory' RSpec.describe 'refund factory' do let(:factory_class) { Spree::Refund } diff --git a/core/spec/lib/spree/core/testing_support/factories/refund_reason_factory_spec.rb b/core/spec/lib/spree/core/testing_support/factories/refund_reason_factory_spec.rb index a7b707d777f..28a003a8223 100644 --- a/core/spec/lib/spree/core/testing_support/factories/refund_reason_factory_spec.rb +++ b/core/spec/lib/spree/core/testing_support/factories/refund_reason_factory_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/shared_examples/working_factory' RSpec.describe 'refund factory' do let(:factory_class) { Spree::Refund } diff --git a/core/spec/lib/spree/core/testing_support/factories/reimbursement_factory_spec.rb b/core/spec/lib/spree/core/testing_support/factories/reimbursement_factory_spec.rb index e62b9150978..256b7af12e2 100644 --- a/core/spec/lib/spree/core/testing_support/factories/reimbursement_factory_spec.rb +++ b/core/spec/lib/spree/core/testing_support/factories/reimbursement_factory_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/shared_examples/working_factory' RSpec.describe 'reimbursement factory' do let(:factory_class) { Spree::Reimbursement } diff --git a/core/spec/lib/spree/core/testing_support/factories/reimbursement_type_factory_spec.rb b/core/spec/lib/spree/core/testing_support/factories/reimbursement_type_factory_spec.rb index 5cd9cd176ac..cb80dd48cae 100644 --- a/core/spec/lib/spree/core/testing_support/factories/reimbursement_type_factory_spec.rb +++ b/core/spec/lib/spree/core/testing_support/factories/reimbursement_type_factory_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/shared_examples/working_factory' RSpec.describe 'reimbursement type factory' do let(:factory_class) { Spree::ReimbursementType } diff --git a/core/spec/lib/spree/core/testing_support/factories/return_authorization_factory_spec.rb b/core/spec/lib/spree/core/testing_support/factories/return_authorization_factory_spec.rb index 4898cd2ad6e..4bac76d427f 100644 --- a/core/spec/lib/spree/core/testing_support/factories/return_authorization_factory_spec.rb +++ b/core/spec/lib/spree/core/testing_support/factories/return_authorization_factory_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/shared_examples/working_factory' RSpec.describe 'return authorization factory' do let(:factory_class) { Spree::ReturnAuthorization } diff --git a/core/spec/lib/spree/core/testing_support/factories/return_item_factory_spec.rb b/core/spec/lib/spree/core/testing_support/factories/return_item_factory_spec.rb index 2d5078f594a..a984040a53c 100644 --- a/core/spec/lib/spree/core/testing_support/factories/return_item_factory_spec.rb +++ b/core/spec/lib/spree/core/testing_support/factories/return_item_factory_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/shared_examples/working_factory' RSpec.describe 'return item factory' do let(:factory_class) { Spree::ReturnItem } diff --git a/core/spec/lib/spree/core/testing_support/factories/return_reason_factory_spec.rb b/core/spec/lib/spree/core/testing_support/factories/return_reason_factory_spec.rb index 344b0a17673..45b23dfd028 100644 --- a/core/spec/lib/spree/core/testing_support/factories/return_reason_factory_spec.rb +++ b/core/spec/lib/spree/core/testing_support/factories/return_reason_factory_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/shared_examples/working_factory' RSpec.describe 'return reason factory' do let(:factory_class) { Spree::ReturnReason } diff --git a/core/spec/lib/spree/core/testing_support/factories/role_factory_spec.rb b/core/spec/lib/spree/core/testing_support/factories/role_factory_spec.rb index df03128cd58..d8a2fa08976 100644 --- a/core/spec/lib/spree/core/testing_support/factories/role_factory_spec.rb +++ b/core/spec/lib/spree/core/testing_support/factories/role_factory_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/shared_examples/working_factory' RSpec.describe 'role factory' do let(:factory_class) { Spree::Role } diff --git a/core/spec/lib/spree/core/testing_support/factories/shipment_factory_spec.rb b/core/spec/lib/spree/core/testing_support/factories/shipment_factory_spec.rb index 988b33f90dd..0b9cb97e4e7 100644 --- a/core/spec/lib/spree/core/testing_support/factories/shipment_factory_spec.rb +++ b/core/spec/lib/spree/core/testing_support/factories/shipment_factory_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/shared_examples/working_factory' RSpec.describe 'shipment factory' do let(:factory_class) { Spree::Shipment } diff --git a/core/spec/lib/spree/core/testing_support/factories/shipping_category_factory_spec.rb b/core/spec/lib/spree/core/testing_support/factories/shipping_category_factory_spec.rb index aabf2b228d7..92e6e0a2fdb 100644 --- a/core/spec/lib/spree/core/testing_support/factories/shipping_category_factory_spec.rb +++ b/core/spec/lib/spree/core/testing_support/factories/shipping_category_factory_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/shared_examples/working_factory' RSpec.describe 'shipping category factory' do let(:factory_class) { Spree::ShippingCategory } diff --git a/core/spec/lib/spree/core/testing_support/factories/shipping_method_factory_spec.rb b/core/spec/lib/spree/core/testing_support/factories/shipping_method_factory_spec.rb index ebecff954a4..fb3557625f9 100644 --- a/core/spec/lib/spree/core/testing_support/factories/shipping_method_factory_spec.rb +++ b/core/spec/lib/spree/core/testing_support/factories/shipping_method_factory_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/shared_examples/working_factory' RSpec.describe 'shipping method factory' do let(:factory_class) { Spree::ShippingMethod } diff --git a/core/spec/lib/spree/core/testing_support/factories/shipping_rate_factory_spec.rb b/core/spec/lib/spree/core/testing_support/factories/shipping_rate_factory_spec.rb index de1d62ffcfe..28f06818d30 100644 --- a/core/spec/lib/spree/core/testing_support/factories/shipping_rate_factory_spec.rb +++ b/core/spec/lib/spree/core/testing_support/factories/shipping_rate_factory_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/shared_examples/working_factory' RSpec.describe 'shipping rate factory' do let(:factory_class) { Spree::ShippingRate } diff --git a/core/spec/lib/spree/core/testing_support/factories/state_factory_spec.rb b/core/spec/lib/spree/core/testing_support/factories/state_factory_spec.rb index 2378fb27f5e..1d897f7fa11 100644 --- a/core/spec/lib/spree/core/testing_support/factories/state_factory_spec.rb +++ b/core/spec/lib/spree/core/testing_support/factories/state_factory_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/shared_examples/working_factory' RSpec.describe 'state factory' do let(:factory_class) { Spree::State } diff --git a/core/spec/lib/spree/core/testing_support/factories/stock_item_factory_spec.rb b/core/spec/lib/spree/core/testing_support/factories/stock_item_factory_spec.rb index 1b745f4bd38..ee217309ab6 100644 --- a/core/spec/lib/spree/core/testing_support/factories/stock_item_factory_spec.rb +++ b/core/spec/lib/spree/core/testing_support/factories/stock_item_factory_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/shared_examples/working_factory' RSpec.describe 'stock item factory' do let(:factory_class) { Spree::StockItem } diff --git a/core/spec/lib/spree/core/testing_support/factories/stock_location_factory_spec.rb b/core/spec/lib/spree/core/testing_support/factories/stock_location_factory_spec.rb index befb0f88c4c..7866762fe8a 100644 --- a/core/spec/lib/spree/core/testing_support/factories/stock_location_factory_spec.rb +++ b/core/spec/lib/spree/core/testing_support/factories/stock_location_factory_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/shared_examples/working_factory' RSpec.describe 'stock location factory' do let(:factory_class) { Spree::StockLocation } diff --git a/core/spec/lib/spree/core/testing_support/factories/stock_movement_factory_spec.rb b/core/spec/lib/spree/core/testing_support/factories/stock_movement_factory_spec.rb index 1ed358e9deb..d58782e6669 100644 --- a/core/spec/lib/spree/core/testing_support/factories/stock_movement_factory_spec.rb +++ b/core/spec/lib/spree/core/testing_support/factories/stock_movement_factory_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/shared_examples/working_factory' RSpec.describe 'stock movement factory' do let(:factory_class) { Spree::StockMovement } diff --git a/core/spec/lib/spree/core/testing_support/factories/stock_package_factory_spec.rb b/core/spec/lib/spree/core/testing_support/factories/stock_package_factory_spec.rb index 1e7645df7e5..d63732810aa 100644 --- a/core/spec/lib/spree/core/testing_support/factories/stock_package_factory_spec.rb +++ b/core/spec/lib/spree/core/testing_support/factories/stock_package_factory_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/shared_examples/working_factory' RSpec.describe 'stock package factory' do let(:factory_class) { Spree::Stock::Package } diff --git a/core/spec/lib/spree/core/testing_support/factories/store_credit_category_factory_spec.rb b/core/spec/lib/spree/core/testing_support/factories/store_credit_category_factory_spec.rb index e22178b5288..61513d2299d 100644 --- a/core/spec/lib/spree/core/testing_support/factories/store_credit_category_factory_spec.rb +++ b/core/spec/lib/spree/core/testing_support/factories/store_credit_category_factory_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/shared_examples/working_factory' RSpec.describe 'store credit category factory' do let(:factory_class) { Spree::StoreCreditCategory } diff --git a/core/spec/lib/spree/core/testing_support/factories/store_credit_event_factory_spec.rb b/core/spec/lib/spree/core/testing_support/factories/store_credit_event_factory_spec.rb index 8cb844cab58..1595edc5747 100644 --- a/core/spec/lib/spree/core/testing_support/factories/store_credit_event_factory_spec.rb +++ b/core/spec/lib/spree/core/testing_support/factories/store_credit_event_factory_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/shared_examples/working_factory' RSpec.describe 'store credit event factory' do let(:factory_class) { Spree::StoreCreditEvent } diff --git a/core/spec/lib/spree/core/testing_support/factories/store_credit_factory_spec.rb b/core/spec/lib/spree/core/testing_support/factories/store_credit_factory_spec.rb index 4bb282597d0..1182107a09a 100644 --- a/core/spec/lib/spree/core/testing_support/factories/store_credit_factory_spec.rb +++ b/core/spec/lib/spree/core/testing_support/factories/store_credit_factory_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/shared_examples/working_factory' RSpec.describe 'store credit factory' do let(:factory_class) { Spree::StoreCredit } diff --git a/core/spec/lib/spree/core/testing_support/factories/store_credit_reason_factory_spec.rb b/core/spec/lib/spree/core/testing_support/factories/store_credit_reason_factory_spec.rb index 55b98c82463..a4f70e49e3a 100644 --- a/core/spec/lib/spree/core/testing_support/factories/store_credit_reason_factory_spec.rb +++ b/core/spec/lib/spree/core/testing_support/factories/store_credit_reason_factory_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/shared_examples/working_factory' RSpec.describe 'store credit reason factory' do let(:factory_class) { Spree::StoreCreditReason } diff --git a/core/spec/lib/spree/core/testing_support/factories/store_credit_type_factory_spec.rb b/core/spec/lib/spree/core/testing_support/factories/store_credit_type_factory_spec.rb index 68dc07d2294..7a2e1e2e634 100644 --- a/core/spec/lib/spree/core/testing_support/factories/store_credit_type_factory_spec.rb +++ b/core/spec/lib/spree/core/testing_support/factories/store_credit_type_factory_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/shared_examples/working_factory' RSpec.describe 'store credit type factory' do let(:factory_class) { Spree::StoreCreditType } diff --git a/core/spec/lib/spree/core/testing_support/factories/store_factory_spec.rb b/core/spec/lib/spree/core/testing_support/factories/store_factory_spec.rb index 86a76c40842..852f063b5cc 100644 --- a/core/spec/lib/spree/core/testing_support/factories/store_factory_spec.rb +++ b/core/spec/lib/spree/core/testing_support/factories/store_factory_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/shared_examples/working_factory' RSpec.describe 'store factory' do let(:factory_class) { Spree::Store } diff --git a/core/spec/lib/spree/core/testing_support/factories/tax_category_factory_spec.rb b/core/spec/lib/spree/core/testing_support/factories/tax_category_factory_spec.rb index 3faaca88bb4..f9254a76367 100644 --- a/core/spec/lib/spree/core/testing_support/factories/tax_category_factory_spec.rb +++ b/core/spec/lib/spree/core/testing_support/factories/tax_category_factory_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/shared_examples/working_factory' RSpec.describe 'tax category factory' do let(:factory_class) { Spree::TaxCategory } diff --git a/core/spec/lib/spree/core/testing_support/factories/tax_rate_factory_spec.rb b/core/spec/lib/spree/core/testing_support/factories/tax_rate_factory_spec.rb index 34e523ef94a..acf6e1a11f4 100644 --- a/core/spec/lib/spree/core/testing_support/factories/tax_rate_factory_spec.rb +++ b/core/spec/lib/spree/core/testing_support/factories/tax_rate_factory_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/shared_examples/working_factory' RSpec.describe 'tax rate factory' do let(:factory_class) { Spree::TaxRate } diff --git a/core/spec/lib/spree/core/testing_support/factories/taxon_factory_spec.rb b/core/spec/lib/spree/core/testing_support/factories/taxon_factory_spec.rb index 6ee5008495b..9243ad67660 100644 --- a/core/spec/lib/spree/core/testing_support/factories/taxon_factory_spec.rb +++ b/core/spec/lib/spree/core/testing_support/factories/taxon_factory_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/shared_examples/working_factory' RSpec.describe 'taxon factory' do let(:factory_class) { Spree::Taxon } diff --git a/core/spec/lib/spree/core/testing_support/factories/taxonomy_factory_spec.rb b/core/spec/lib/spree/core/testing_support/factories/taxonomy_factory_spec.rb index fecf8b79e74..c1abe7f9dae 100644 --- a/core/spec/lib/spree/core/testing_support/factories/taxonomy_factory_spec.rb +++ b/core/spec/lib/spree/core/testing_support/factories/taxonomy_factory_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/shared_examples/working_factory' RSpec.describe 'taxonomy factory' do let(:factory_class) { Spree::Taxonomy } diff --git a/core/spec/lib/spree/core/testing_support/factories/user_factory_spec.rb b/core/spec/lib/spree/core/testing_support/factories/user_factory_spec.rb index a8c180013f4..d1ff94bb087 100644 --- a/core/spec/lib/spree/core/testing_support/factories/user_factory_spec.rb +++ b/core/spec/lib/spree/core/testing_support/factories/user_factory_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/shared_examples/working_factory' RSpec.describe 'user factory' do let(:factory_class) { Spree.user_class } diff --git a/core/spec/lib/spree/core/testing_support/factories/variant_factory_spec.rb b/core/spec/lib/spree/core/testing_support/factories/variant_factory_spec.rb index 58440a19aa8..80ed35f1f42 100644 --- a/core/spec/lib/spree/core/testing_support/factories/variant_factory_spec.rb +++ b/core/spec/lib/spree/core/testing_support/factories/variant_factory_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/shared_examples/working_factory' RSpec.describe 'variant factory' do let(:factory_class) { Spree::Variant } diff --git a/core/spec/lib/spree/core/testing_support/factories/variant_property_rule_condition_factory_spec.rb b/core/spec/lib/spree/core/testing_support/factories/variant_property_rule_condition_factory_spec.rb index aad297ca695..021814276dd 100644 --- a/core/spec/lib/spree/core/testing_support/factories/variant_property_rule_condition_factory_spec.rb +++ b/core/spec/lib/spree/core/testing_support/factories/variant_property_rule_condition_factory_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/shared_examples/working_factory' RSpec.describe 'variant property rule condition factory' do let(:factory_class) { Spree::VariantPropertyRuleCondition } diff --git a/core/spec/lib/spree/core/testing_support/factories/variant_property_rule_factory_spec.rb b/core/spec/lib/spree/core/testing_support/factories/variant_property_rule_factory_spec.rb index 8ed95693d1a..f2fe8076039 100644 --- a/core/spec/lib/spree/core/testing_support/factories/variant_property_rule_factory_spec.rb +++ b/core/spec/lib/spree/core/testing_support/factories/variant_property_rule_factory_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/shared_examples/working_factory' RSpec.describe 'variant property rule factory' do let(:factory_class) { Spree::VariantPropertyRule } diff --git a/core/spec/lib/spree/core/testing_support/factories/variant_property_rule_value_factory_spec.rb b/core/spec/lib/spree/core/testing_support/factories/variant_property_rule_value_factory_spec.rb index 5eadca88a68..7a5a0d00f7e 100644 --- a/core/spec/lib/spree/core/testing_support/factories/variant_property_rule_value_factory_spec.rb +++ b/core/spec/lib/spree/core/testing_support/factories/variant_property_rule_value_factory_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/shared_examples/working_factory' RSpec.describe 'variant property rule value factory' do let(:factory_class) { Spree::VariantPropertyRuleValue } diff --git a/core/spec/lib/spree/core/testing_support/factories/zone_factory_spec.rb b/core/spec/lib/spree/core/testing_support/factories/zone_factory_spec.rb index f4f3c80519d..23f2adc1a85 100644 --- a/core/spec/lib/spree/core/testing_support/factories/zone_factory_spec.rb +++ b/core/spec/lib/spree/core/testing_support/factories/zone_factory_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/shared_examples/working_factory' RSpec.describe 'zone factory' do let(:factory_class) { Spree::Zone } diff --git a/core/spec/models/spree/calculator/default_tax_spec.rb b/core/spec/models/spree/calculator/default_tax_spec.rb index ea7bc93593a..35352d9d13c 100644 --- a/core/spec/models/spree/calculator/default_tax_spec.rb +++ b/core/spec/models/spree/calculator/default_tax_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'rails_helper' -require 'shared_examples/calculator_shared_examples' +require 'spree/testing_support/shared_examples/calculator' RSpec.describe Spree::Calculator::DefaultTax, type: :model do let(:address) { create(:address) } diff --git a/core/spec/models/spree/calculator/distributed_amount_spec.rb b/core/spec/models/spree/calculator/distributed_amount_spec.rb index 17f9eee82fc..ffba048490c 100644 --- a/core/spec/models/spree/calculator/distributed_amount_spec.rb +++ b/core/spec/models/spree/calculator/distributed_amount_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'rails_helper' -require 'shared_examples/calculator_shared_examples' +require 'spree/testing_support/shared_examples/calculator' RSpec.describe Spree::Calculator::DistributedAmount, type: :model do context 'applied to an order' do diff --git a/core/spec/models/spree/calculator/flat_fee_spec.rb b/core/spec/models/spree/calculator/flat_fee_spec.rb index 187aeb70582..97f1b64c649 100644 --- a/core/spec/models/spree/calculator/flat_fee_spec.rb +++ b/core/spec/models/spree/calculator/flat_fee_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require "rails_helper" -require "shared_examples/calculator_shared_examples" +require 'spree/testing_support/shared_examples/calculator' RSpec.describe Spree::Calculator::FlatFee, type: :model do let(:tax_rate) { build(:tax_rate, amount: 42) } diff --git a/core/spec/models/spree/calculator/flat_percent_item_total_spec.rb b/core/spec/models/spree/calculator/flat_percent_item_total_spec.rb index 3c4565a5714..dad78a5df3f 100644 --- a/core/spec/models/spree/calculator/flat_percent_item_total_spec.rb +++ b/core/spec/models/spree/calculator/flat_percent_item_total_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'rails_helper' -require 'shared_examples/calculator_shared_examples' +require 'spree/testing_support/shared_examples/calculator' RSpec.describe Spree::Calculator::FlatPercentItemTotal, type: :model do let(:calculator) { Spree::Calculator::FlatPercentItemTotal.new } diff --git a/core/spec/models/spree/calculator/flat_rate_spec.rb b/core/spec/models/spree/calculator/flat_rate_spec.rb index 8b986aaa087..5e7b4fe91ae 100644 --- a/core/spec/models/spree/calculator/flat_rate_spec.rb +++ b/core/spec/models/spree/calculator/flat_rate_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'rails_helper' -require 'shared_examples/calculator_shared_examples' +require 'spree/testing_support/shared_examples/calculator' RSpec.describe Spree::Calculator::FlatRate, type: :model do let(:calculator) { Spree::Calculator::FlatRate.new } diff --git a/core/spec/models/spree/calculator/flexi_rate_spec.rb b/core/spec/models/spree/calculator/flexi_rate_spec.rb index 64d0a6394d7..8d1beb573bb 100644 --- a/core/spec/models/spree/calculator/flexi_rate_spec.rb +++ b/core/spec/models/spree/calculator/flexi_rate_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'rails_helper' -require 'shared_examples/calculator_shared_examples' +require 'spree/testing_support/shared_examples/calculator' RSpec.describe Spree::Calculator::FlexiRate, type: :model do let(:calculator) do diff --git a/core/spec/models/spree/calculator/percent_on_line_item_spec.rb b/core/spec/models/spree/calculator/percent_on_line_item_spec.rb index 7d98485c0c9..da73cf2180e 100644 --- a/core/spec/models/spree/calculator/percent_on_line_item_spec.rb +++ b/core/spec/models/spree/calculator/percent_on_line_item_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'rails_helper' -require 'shared_examples/calculator_shared_examples' +require 'spree/testing_support/shared_examples/calculator' module Spree RSpec.describe Calculator::PercentOnLineItem, type: :model do diff --git a/core/spec/models/spree/calculator/refunds/default_refund_amount_spec.rb b/core/spec/models/spree/calculator/refunds/default_refund_amount_spec.rb index f5d9c88e969..9a07fa5d40d 100644 --- a/core/spec/models/spree/calculator/refunds/default_refund_amount_spec.rb +++ b/core/spec/models/spree/calculator/refunds/default_refund_amount_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'rails_helper' -require 'shared_examples/calculator_shared_examples' +require 'spree/testing_support/shared_examples/calculator' RSpec.describe Spree::Calculator::Returns::DefaultRefundAmount, type: :model do let(:line_item_quantity) { 3 } diff --git a/core/spec/models/spree/calculator/shipping/flat_percent_item_total_spec.rb b/core/spec/models/spree/calculator/shipping/flat_percent_item_total_spec.rb index 35055b29f38..71ae6b69cb3 100644 --- a/core/spec/models/spree/calculator/shipping/flat_percent_item_total_spec.rb +++ b/core/spec/models/spree/calculator/shipping/flat_percent_item_total_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'rails_helper' -require 'shared_examples/calculator_shared_examples' +require 'spree/testing_support/shared_examples/calculator' module Spree module Calculator::Shipping diff --git a/core/spec/models/spree/calculator/shipping/flat_rate_spec.rb b/core/spec/models/spree/calculator/shipping/flat_rate_spec.rb index f82c849dabf..1bc3b3d410e 100644 --- a/core/spec/models/spree/calculator/shipping/flat_rate_spec.rb +++ b/core/spec/models/spree/calculator/shipping/flat_rate_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'rails_helper' -require 'shared_examples/calculator_shared_examples' +require 'spree/testing_support/shared_examples/calculator' module Spree module Calculator::Shipping diff --git a/core/spec/models/spree/calculator/shipping/flexi_rate_spec.rb b/core/spec/models/spree/calculator/shipping/flexi_rate_spec.rb index 6fc397b7ea4..1238ced88be 100644 --- a/core/spec/models/spree/calculator/shipping/flexi_rate_spec.rb +++ b/core/spec/models/spree/calculator/shipping/flexi_rate_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'rails_helper' -require 'shared_examples/calculator_shared_examples' +require 'spree/testing_support/shared_examples/calculator' module Spree module Calculator::Shipping diff --git a/core/spec/models/spree/calculator/shipping/per_item_spec.rb b/core/spec/models/spree/calculator/shipping/per_item_spec.rb index de3b7b42475..c85ae73ca46 100644 --- a/core/spec/models/spree/calculator/shipping/per_item_spec.rb +++ b/core/spec/models/spree/calculator/shipping/per_item_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'rails_helper' -require 'shared_examples/calculator_shared_examples' +require 'spree/testing_support/shared_examples/calculator' module Spree module Calculator::Shipping diff --git a/core/spec/models/spree/calculator/shipping/price_sack_spec.rb b/core/spec/models/spree/calculator/shipping/price_sack_spec.rb index b7df6b3c250..2150a85af9c 100644 --- a/core/spec/models/spree/calculator/shipping/price_sack_spec.rb +++ b/core/spec/models/spree/calculator/shipping/price_sack_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'rails_helper' -require 'shared_examples/calculator_shared_examples' +require 'spree/testing_support/shared_examples/calculator' RSpec.describe Spree::Calculator::Shipping::PriceSack, type: :model do let(:calculator) do diff --git a/core/spec/models/spree/calculator/tiered_flat_rate_spec.rb b/core/spec/models/spree/calculator/tiered_flat_rate_spec.rb index e81e9647cc1..36af4d70b78 100644 --- a/core/spec/models/spree/calculator/tiered_flat_rate_spec.rb +++ b/core/spec/models/spree/calculator/tiered_flat_rate_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'rails_helper' -require 'shared_examples/calculator_shared_examples' +require 'spree/testing_support/shared_examples/calculator' RSpec.describe Spree::Calculator::TieredFlatRate, type: :model do let(:calculator) { Spree::Calculator::TieredFlatRate.new } diff --git a/core/spec/models/spree/calculator/tiered_percent_spec.rb b/core/spec/models/spree/calculator/tiered_percent_spec.rb index 410c7c1b29a..00b747c3e7b 100644 --- a/core/spec/models/spree/calculator/tiered_percent_spec.rb +++ b/core/spec/models/spree/calculator/tiered_percent_spec.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true require 'rails_helper' -require 'shared_examples/calculator_shared_examples' +require 'spree/testing_support/shared_examples/calculator' RSpec.describe Spree::Calculator::TieredPercent, type: :model do let(:calculator) { Spree::Calculator::TieredPercent.new } diff --git a/core/spec/models/spree/permission_sets/configuration_display.rb b/core/spec/models/spree/permission_sets/configuration_display.rb index b9eab408a19..0489d1f8825 100644 --- a/core/spec/models/spree/permission_sets/configuration_display.rb +++ b/core/spec/models/spree/permission_sets/configuration_display.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/dummy_ability' RSpec.describe Spree::PermissionSets::ConfigurationDisplay do let(:ability) { DummyAbility.new } diff --git a/core/spec/models/spree/permission_sets/configuration_management_spec.rb b/core/spec/models/spree/permission_sets/configuration_management_spec.rb index e067aa84c53..fdb26475b1c 100644 --- a/core/spec/models/spree/permission_sets/configuration_management_spec.rb +++ b/core/spec/models/spree/permission_sets/configuration_management_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/dummy_ability' RSpec.describe Spree::PermissionSets::ConfigurationManagement do let(:ability) { DummyAbility.new } diff --git a/core/spec/models/spree/permission_sets/dashboard_display_spec.rb b/core/spec/models/spree/permission_sets/dashboard_display_spec.rb index b6945e6be7c..e60279eec6d 100644 --- a/core/spec/models/spree/permission_sets/dashboard_display_spec.rb +++ b/core/spec/models/spree/permission_sets/dashboard_display_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/dummy_ability' RSpec.describe Spree::PermissionSets::DashboardDisplay do let(:ability) { DummyAbility.new } diff --git a/core/spec/models/spree/permission_sets/order_display_spec.rb b/core/spec/models/spree/permission_sets/order_display_spec.rb index 92793eb672e..c6b799ae055 100644 --- a/core/spec/models/spree/permission_sets/order_display_spec.rb +++ b/core/spec/models/spree/permission_sets/order_display_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/dummy_ability' RSpec.describe Spree::PermissionSets::OrderDisplay do let(:ability) { DummyAbility.new } diff --git a/core/spec/models/spree/permission_sets/order_management_spec.rb b/core/spec/models/spree/permission_sets/order_management_spec.rb index 9084102ecd8..11a9bcf4cdb 100644 --- a/core/spec/models/spree/permission_sets/order_management_spec.rb +++ b/core/spec/models/spree/permission_sets/order_management_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/dummy_ability' RSpec.describe Spree::PermissionSets::OrderManagement do let(:ability) { DummyAbility.new } diff --git a/core/spec/models/spree/permission_sets/product_display_spec.rb b/core/spec/models/spree/permission_sets/product_display_spec.rb index e2dc0afb67d..45080f8e176 100644 --- a/core/spec/models/spree/permission_sets/product_display_spec.rb +++ b/core/spec/models/spree/permission_sets/product_display_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/dummy_ability' RSpec.describe Spree::PermissionSets::ProductDisplay do let(:ability) { DummyAbility.new } diff --git a/core/spec/models/spree/permission_sets/product_management_spec.rb b/core/spec/models/spree/permission_sets/product_management_spec.rb index 74266bec9d8..9c533c04fe2 100644 --- a/core/spec/models/spree/permission_sets/product_management_spec.rb +++ b/core/spec/models/spree/permission_sets/product_management_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/dummy_ability' RSpec.describe Spree::PermissionSets::ProductManagement do let(:ability) { DummyAbility.new } diff --git a/core/spec/models/spree/permission_sets/promotion_display_spec.rb b/core/spec/models/spree/permission_sets/promotion_display_spec.rb index 4b67fd784e0..053e61ed857 100644 --- a/core/spec/models/spree/permission_sets/promotion_display_spec.rb +++ b/core/spec/models/spree/permission_sets/promotion_display_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/dummy_ability' RSpec.describe Spree::PermissionSets::PromotionDisplay do let(:ability) { DummyAbility.new } diff --git a/core/spec/models/spree/permission_sets/promotion_management_spec.rb b/core/spec/models/spree/permission_sets/promotion_management_spec.rb index 96786aec30b..b1829e33e7c 100644 --- a/core/spec/models/spree/permission_sets/promotion_management_spec.rb +++ b/core/spec/models/spree/permission_sets/promotion_management_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/dummy_ability' RSpec.describe Spree::PermissionSets::PromotionManagement do let(:ability) { DummyAbility.new } diff --git a/core/spec/models/spree/permission_sets/stock_display_spec.rb b/core/spec/models/spree/permission_sets/stock_display_spec.rb index 94a1f8e78fd..e5515b3f121 100644 --- a/core/spec/models/spree/permission_sets/stock_display_spec.rb +++ b/core/spec/models/spree/permission_sets/stock_display_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/dummy_ability' RSpec.describe Spree::PermissionSets::StockDisplay do let(:ability) { DummyAbility.new } diff --git a/core/spec/models/spree/permission_sets/stock_management_spec.rb b/core/spec/models/spree/permission_sets/stock_management_spec.rb index cf23875fecb..97eec759977 100644 --- a/core/spec/models/spree/permission_sets/stock_management_spec.rb +++ b/core/spec/models/spree/permission_sets/stock_management_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/dummy_ability' RSpec.describe Spree::PermissionSets::StockManagement do let(:ability) { DummyAbility.new } diff --git a/core/spec/models/spree/permission_sets/user_display_spec.rb b/core/spec/models/spree/permission_sets/user_display_spec.rb index bb5691502dd..3adc806e4b5 100644 --- a/core/spec/models/spree/permission_sets/user_display_spec.rb +++ b/core/spec/models/spree/permission_sets/user_display_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/dummy_ability' RSpec.describe Spree::PermissionSets::UserDisplay do let(:ability) { DummyAbility.new } diff --git a/core/spec/models/spree/permission_sets/user_management_spec.rb b/core/spec/models/spree/permission_sets/user_management_spec.rb index 27c0f27eb0d..d148b8c4ed5 100644 --- a/core/spec/models/spree/permission_sets/user_management_spec.rb +++ b/core/spec/models/spree/permission_sets/user_management_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require 'rails_helper' +require 'spree/testing_support/dummy_ability' RSpec.describe Spree::PermissionSets::UserManagement do let(:ability) { DummyAbility.new }