diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 886a215d2fa..7e96581346d 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -879,36 +879,6 @@ Style/HashLikeCase: # SupportedShorthandSyntax: always, never, either, consistent Style/HashSyntax: Exclude: - - 'spec/services/tax_rate_finder_spec.rb' - - 'spec/services/user_default_address_setter_spec.rb' - - 'spec/services/variants_stock_levels_spec.rb' - - 'spec/services/voucher_adjustments_service_spec.rb' - - 'spec/support/controller_helper.rb' - - 'spec/support/controller_requests_helper.rb' - - 'spec/support/request/stripe_stubs.rb' - - 'spec/support/request/ui_component_helper.rb' - - 'spec/support/request/web_helper.rb' - - 'spec/system/admin/adjustments_spec.rb' - - 'spec/system/admin/bulk_product_update_spec.rb' - - 'spec/system/admin/configuration/states_spec.rb' - - 'spec/system/admin/configuration/tax_rates_spec.rb' - - 'spec/system/admin/customers_spec.rb' - - 'spec/system/admin/enterprises_spec.rb' - - 'spec/system/admin/invoice_print_spec.rb' - - 'spec/system/admin/order_cycles/complex_creating_specific_time_spec.rb' - - 'spec/system/admin/order_cycles/complex_updating_specific_time_spec.rb' - - 'spec/system/admin/order_cycles/simple_spec.rb' - - 'spec/system/admin/order_spec.rb' - - 'spec/system/admin/orders_spec.rb' - - 'spec/system/admin/payments_stripe_spec.rb' - - 'spec/system/admin/reports/enterprise_fee_summaries_spec.rb' - - 'spec/system/admin/reports/enterprise_summary_fees/enterprise_summary_fee_with_tax_report_by_order_spec.rb' - - 'spec/system/admin/reports/orders_and_fulfillment_spec.rb' - - 'spec/system/admin/reports/packing_report_spec.rb' - - 'spec/system/admin/reports/payments_report_spec.rb' - - 'spec/system/admin/reports/revenues_by_hub_spec.rb' - - 'spec/system/admin/reports/sales_tax/sales_tax_totals_by_order_spec.rb' - - 'spec/system/admin/reports/sales_tax/sales_tax_totals_by_producer_spec.rb' - 'spec/system/admin/reports_spec.rb' - 'spec/system/admin/subscriptions_spec.rb' - 'spec/system/admin/tag_rules_spec.rb' diff --git a/spec/services/tax_rate_finder_spec.rb b/spec/services/tax_rate_finder_spec.rb index b62b3489057..3ceca796074 100644 --- a/spec/services/tax_rate_finder_spec.rb +++ b/spec/services/tax_rate_finder_spec.rb @@ -6,19 +6,19 @@ describe "getting the corresponding tax rate" do let(:amount) { BigDecimal(120) } let(:tax_rate) { - create(:tax_rate, amount: 0.2, calculator: Calculator::DefaultTax.new, zone: zone) + create(:tax_rate, amount: 0.2, calculator: Calculator::DefaultTax.new, zone:) } let(:tax_rate_shipping) { - create(:tax_rate, amount: 0.05, calculator: Calculator::DefaultTax.new, zone: zone) + create(:tax_rate, amount: 0.05, calculator: Calculator::DefaultTax.new, zone:) } let(:tax_category) { create(:tax_category, tax_rates: [tax_rate]) } let(:tax_category_shipping) { create(:tax_category, tax_rates: [tax_rate_shipping]) } let(:zone) { create(:zone_with_member) } let(:shipping_method) { create(:shipping_method, tax_category: tax_category_shipping) } - let(:shipment) { create(:shipment_with, :shipping_method, shipping_method: shipping_method) } + let(:shipment) { create(:shipment_with, :shipping_method, shipping_method:) } let(:line_item) { create(:line_item) } - let(:enterprise_fee) { create(:enterprise_fee, tax_category: tax_category) } - let(:order) { create(:order_with_taxes, zone: zone) } + let(:enterprise_fee) { create(:enterprise_fee, tax_category:) } + let(:order) { create(:order_with_taxes, zone:) } subject { TaxRateFinder.new } diff --git a/spec/services/user_default_address_setter_spec.rb b/spec/services/user_default_address_setter_spec.rb index 4cc8ef2f925..2e8ec3319d8 100644 --- a/spec/services/user_default_address_setter_spec.rb +++ b/spec/services/user_default_address_setter_spec.rb @@ -9,7 +9,7 @@ create(:customer, bill_address: customer_address, ship_address: customer_address) end let(:order) do - create(:order, customer: customer, bill_address: order_address, ship_address: order_address) + create(:order, customer:, bill_address: order_address, ship_address: order_address) end let(:user) { create(:user) } diff --git a/spec/services/variants_stock_levels_spec.rb b/spec/services/variants_stock_levels_spec.rb index 998a2d8fb3a..475f9fb4523 100644 --- a/spec/services/variants_stock_levels_spec.rb +++ b/spec/services/variants_stock_levels_spec.rb @@ -6,7 +6,7 @@ let(:order) { create(:order) } let!(:line_item) do - create(:line_item, order: order, variant: variant_in_the_order, quantity: 2, max_quantity: 3) + create(:line_item, order:, variant: variant_in_the_order, quantity: 2, max_quantity: 3) end let!(:variant_in_the_order) { create(:variant) } let!(:variant_not_in_the_order) { create(:variant) } diff --git a/spec/services/voucher_adjustments_service_spec.rb b/spec/services/voucher_adjustments_service_spec.rb index d31d616b446..4b47f17997b 100644 --- a/spec/services/voucher_adjustments_service_spec.rb +++ b/spec/services/voucher_adjustments_service_spec.rb @@ -8,7 +8,7 @@ context 'with a flat rate voucher' do let(:voucher) do - create(:voucher_flat_rate, code: 'new_code', enterprise: enterprise, amount: 10) + create(:voucher_flat_rate, code: 'new_code', enterprise:, amount: 10) end context 'when voucher covers the order total' do @@ -168,7 +168,7 @@ context 'with a percentage rate voucher' do let(:voucher) do - create(:voucher_percentage_rate, code: 'new_code', enterprise: enterprise, amount: 10) + create(:voucher_percentage_rate, code: 'new_code', enterprise:, amount: 10) end let(:adjustment) { order.voucher_adjustments.first } let(:tax_adjustment) { order.voucher_adjustments.second } @@ -177,7 +177,7 @@ subject { order.voucher_adjustments.first } let(:voucher) do - create(:voucher_percentage_rate, code: 'new_code', enterprise: enterprise, amount: 100) + create(:voucher_percentage_rate, code: 'new_code', enterprise:, amount: 100) end let(:order) { create(:order_with_totals) } diff --git a/spec/support/controller_helper.rb b/spec/support/controller_helper.rb index 622afe37f6c..c7cc66b6e25 100644 --- a/spec/support/controller_helper.rb +++ b/spec/support/controller_helper.rb @@ -17,7 +17,7 @@ def controller_login_as_enterprise_user(enterprises) user = create(:user) user.spree_roles = [] enterprises.each do |enterprise| - enterprise.enterprise_roles.create!(user: user) + enterprise.enterprise_roles.create!(user:) end user end diff --git a/spec/support/controller_requests_helper.rb b/spec/support/controller_requests_helper.rb index 4b992f5949f..d6e9e92330a 100644 --- a/spec/support/controller_requests_helper.rb +++ b/spec/support/controller_requests_helper.rb @@ -47,9 +47,9 @@ def process_json_action(action, params = {}, session = nil, flash = nil, method def process_action_with_route(action, params = {}, session = nil, flash = nil, method = "GET") process(action, - method: method, + method:, params: params.reverse_merge!(use_route: :main_app), - session: session, - flash: flash) + session:, + flash:) end end diff --git a/spec/support/request/stripe_stubs.rb b/spec/support/request/stripe_stubs.rb index 4907a3b56fa..b2943741cac 100644 --- a/spec/support/request/stripe_stubs.rb +++ b/spec/support/request/stripe_stubs.rb @@ -32,7 +32,7 @@ def stub_payment_methods_post_request(request: { payment_method: "pm_123" }, res def stub_payment_method_attach_request(payment_method: "pm_123", customer: "cus_A123") stub_request(:post, "https://api.stripe.com/v1/payment_methods/#{payment_method}/attach") - .with(body: { customer: customer }) + .with(body: { customer: }) .to_return(hub_payment_method_response_mock({ pm_id: payment_method })) end @@ -44,7 +44,7 @@ def stub_retrieve_payment_method_request(payment_method_id = "pm_1234") # Stubs the customers call to both the main stripe account and the connected account def stub_customers_post_request(email:, response: {}, stripe_account_header: false) stub = stub_request(:post, "https://api.stripe.com/v1/customers") - .with(body: { email: email }) + .with(body: { email: }) stub = stub.with(headers: { 'Stripe-Account' => 'abc123' }) if stripe_account_header stub.to_return(customers_response_mock(response)) end @@ -174,7 +174,7 @@ def get_customer_payment_methods_response_mock(options) body: JSON.generate( object: "list", has_more: false, - data: [{ id: payment_method, card: { fingerprint: fingerprint } }], + data: [{ id: payment_method, card: { fingerprint: } }], ), } end diff --git a/spec/support/request/ui_component_helper.rb b/spec/support/request/ui_component_helper.rb index 30d6d02d4f4..06440e11846 100644 --- a/spec/support/request/ui_component_helper.rb +++ b/spec/support/request/ui_component_helper.rb @@ -37,7 +37,7 @@ def click_reset_password_button def select_login_tab(text) within ".login-modal" do - page.find("a", text: text).click + page.find("a", text:).click end sleep 0.2 end diff --git a/spec/support/request/web_helper.rb b/spec/support/request/web_helper.rb index b20b31bf45c..10efa756936 100644 --- a/spec/support/request/web_helper.rb +++ b/spec/support/request/web_helper.rb @@ -7,10 +7,10 @@ def have_input(name, opts = {}) visible = opts.key?(:visible) ? opts[:visible] : true - element = page.all(selector, visible: visible).first + element = page.all(selector, visible:).first expect(element.value).to eq(opts[:with]) if element && opts.key?(:with) - have_selector selector, visible: visible + have_selector selector, visible: end def select_by_value(value, options = {}) diff --git a/spec/system/admin/adjustments_spec.rb b/spec/system/admin/adjustments_spec.rb index 89224ac7780..9f5a3b1f67c 100644 --- a/spec/system/admin/adjustments_spec.rb +++ b/spec/system/admin/adjustments_spec.rb @@ -14,14 +14,14 @@ let!(:order_cycle) { create(:simple_order_cycle, distributors: [distributor]) } let!(:order) { - create(:order_with_totals_and_distribution, user: user, distributor: distributor, - order_cycle: order_cycle, state: 'complete', + create(:order_with_totals_and_distribution, user:, distributor:, + order_cycle:, state: 'complete', payment_state: 'balance_due') } let!(:tax_category) { create(:tax_category, name: 'GST') } let!(:tax_rate) { create(:tax_rate, name: 'GST', calculator: build(:calculator, preferred_amount: 10), - zone: create(:zone_with_member), tax_category: tax_category) + zone: create(:zone_with_member), tax_category:) } let!(:tax_category_included) { create(:tax_category, name: 'TVA 20%', is_default: true) } @@ -33,7 +33,7 @@ before do order.finalize! - create(:check_payment, order: order, amount: order.total) + create(:check_payment, order:, amount: order.total) login_as_admin visit spree.admin_orders_path end @@ -124,7 +124,7 @@ it "modifying taxed adjustments on an order" do # Given a taxed adjustment adjustment = create(:adjustment, label: "Extra Adjustment", adjustable: order, - amount: 110, tax_category: tax_category, order: order) + amount: 110, tax_category:, order:) # When I go to the adjustments page for the order page.find('td.actions a.icon-edit').click @@ -145,7 +145,7 @@ it "modifying an untaxed adjustment on an order" do # Given an untaxed adjustment adjustment = create(:adjustment, label: "Extra Adjustment", adjustable: order, - amount: 110, tax_category: nil, order: order) + amount: 110, tax_category: nil, order:) # When I go to the adjustments page for the order page.find('td.actions a.icon-edit').click @@ -167,7 +167,7 @@ # Given a taxed adjustment let!(:adjustment) { create(:adjustment, label: "Extra Adjustment", adjustable: order, - amount: 110, tax_category: tax_category, order: order) + amount: 110, tax_category:, order:) } before do order.cancel! diff --git a/spec/system/admin/bulk_product_update_spec.rb b/spec/system/admin/bulk_product_update_spec.rb index cb1c80e2811..9444cc87ab1 100644 --- a/spec/system/admin/bulk_product_update_spec.rb +++ b/spec/system/admin/bulk_product_update_spec.rb @@ -171,7 +171,7 @@ let!(:product) { create(:product) } let(:variant) { product.variants.first } let(:hub) { create(:distributor_enterprise) } - let!(:override) { create(:variant_override, variant: variant, hub: hub ) } + let!(:override) { create(:variant_override, variant:, hub: ) } let(:variant_overrides_tip) { "This variant has %d override(s)" % 1 } @@ -269,8 +269,8 @@ end context "handle the 'on_demand' variant case creation" do - let(:v1) { create(:variant, product: product, on_hand: 4) } - let(:v2) { create(:variant, product: product, on_demand: true) } + let(:v1) { create(:variant, product:, on_hand: 4) } + let(:v2) { create(:variant, product:, on_demand: true) } before do product.variants << v1 diff --git a/spec/system/admin/configuration/states_spec.rb b/spec/system/admin/configuration/states_spec.rb index c6200d1171f..8f44e489576 100644 --- a/spec/system/admin/configuration/states_spec.rb +++ b/spec/system/admin/configuration/states_spec.rb @@ -30,7 +30,7 @@ def go_to_states_page end context "admin visiting states listing" do - let!(:state) { Spree::State.create(name: 'Alabama', country: country) } + let!(:state) { Spree::State.create(name: 'Alabama', country:) } it "should correctly display the states" do visit spree.admin_country_states_path(country) diff --git a/spec/system/admin/configuration/tax_rates_spec.rb b/spec/system/admin/configuration/tax_rates_spec.rb index 89b8d8872bd..da48c549d81 100644 --- a/spec/system/admin/configuration/tax_rates_spec.rb +++ b/spec/system/admin/configuration/tax_rates_spec.rb @@ -6,7 +6,7 @@ include AuthenticationHelper let!(:calculator) { create(:calculator_per_item, calculable: create(:order)) } - let!(:tax_rate) { create(:tax_rate, name: "IVA", calculator: calculator) } + let!(:tax_rate) { create(:tax_rate, name: "IVA", calculator:) } let!(:zone) { create(:zone, name: "Ilhas") } let!(:tax_category) { create(:tax_category, name: "Full") } diff --git a/spec/system/admin/customers_spec.rb b/spec/system/admin/customers_spec.rb index f0c278b0fcb..8c82778f866 100644 --- a/spec/system/admin/customers_spec.rb +++ b/spec/system/admin/customers_spec.rb @@ -132,7 +132,7 @@ create(:stripe_sca_payment_method, distributors: [managed_distributor1]) } let!(:payment1) { - create(:payment, :completed, order: order1, payment_method: payment_method, + create(:payment, :completed, order: order1, payment_method:, response_code: 'pi_123', amount: 88.00) } @@ -162,7 +162,7 @@ context "with an additional negative payment (or refund)" do let!(:payment2) { - create(:payment, :completed, order: order1, payment_method: payment_method, + create(:payment, :completed, order: order1, payment_method:, response_code: 'pi_123', amount: -25.00) } diff --git a/spec/system/admin/enterprises_spec.rb b/spec/system/admin/enterprises_spec.rb index c07c006595b..3e550a0167b 100644 --- a/spec/system/admin/enterprises_spec.rb +++ b/spec/system/admin/enterprises_spec.rb @@ -801,7 +801,7 @@ } before do - distributor1.update(custom_tab: custom_tab) + distributor1.update(custom_tab:) visit edit_admin_enterprise_path(distributor1) within(".side_menu") do click_link "White Label" @@ -842,7 +842,7 @@ context "changing package" do let!(:owner) { create(:user) } - let!(:enterprise) { create(:distributor_enterprise, owner: owner, is_primary_producer: true) } + let!(:enterprise) { create(:distributor_enterprise, owner:, is_primary_producer: true) } before do login_as owner end diff --git a/spec/system/admin/invoice_print_spec.rb b/spec/system/admin/invoice_print_spec.rb index a33ab225e14..76a1b35b428 100644 --- a/spec/system/admin/invoice_print_spec.rb +++ b/spec/system/admin/invoice_print_spec.rb @@ -21,8 +21,8 @@ end let(:order) do - create(:order_with_totals_and_distribution, user: user, distributor: distributor, - order_cycle: order_cycle, state: 'complete', + create(:order_with_totals_and_distribution, user:, distributor:, + order_cycle:, state: 'complete', payment_state: 'balance_due') end @@ -54,7 +54,7 @@ context "with one payment" do let!(:payment1) do - create(:payment, :completed, order: order, payment_method: payment_method1) + create(:payment, :completed, order:, payment_method: payment_method1) end before do order.save! @@ -72,10 +72,10 @@ context "with two payments, and one that failed" do before do order.update payments: [] - order.payments << create(:payment, :completed, order: order, + order.payments << create(:payment, :completed, order:, payment_method: payment_method1, created_at: 1.day.ago) - order.payments << create(:payment, order: order, state: 'failed', + order.payments << create(:payment, order:, state: 'failed', payment_method: payment_method2, created_at: 2.days.ago) order.save! end @@ -92,10 +92,10 @@ context "with two completed payments" do before do order.update payments: [] - order.payments << create(:payment, :completed, order: order, + order.payments << create(:payment, :completed, order:, payment_method: payment_method1, created_at: 2.days.ago) - order.payments << create(:payment, :completed, order: order, + order.payments << create(:payment, :completed, order:, payment_method: payment_method2, created_at: 1.day.ago) order.save! @@ -113,7 +113,7 @@ shared_examples "Check display on each invoice: legacy and alternative" do |alternative_invoice| let!(:completed_order) do - create(:completed_order_with_fees, distributor: distributor, order_cycle: order_cycle, + create(:completed_order_with_fees, distributor:, order_cycle:, user: create(:user, email: "xxxxxx@example.com"), bill_address: create(:address, phone: '1234567890')) end @@ -141,10 +141,10 @@ context "included" do let(:shipping_tax_rate_included) { - create(:tax_rate, amount: 0.1, included_in_price: true, zone: zone) + create(:tax_rate, amount: 0.1, included_in_price: true, zone:) } let(:enterprise_fee_rate_included) { - create(:tax_rate, amount: 0.15, included_in_price: true, zone: zone) + create(:tax_rate, amount: 0.15, included_in_price: true, zone:) } let(:shipping_tax_category) { create(:tax_category, tax_rates: [shipping_tax_rate_included]) } let(:fee_tax_category) { create(:tax_category, tax_rates: [enterprise_fee_rate_included]) } @@ -164,15 +164,15 @@ } let!(:order1) { - create(:order, order_cycle: order_cycle, distributor: user1.enterprises.first, + create(:order, order_cycle:, distributor: user1.enterprises.first, ship_address: address, bill_address: address) } let!(:product1) { - create(:taxed_product, zone: zone, price: 12.54, tax_rate_amount: 0, + create(:taxed_product, zone:, price: 12.54, tax_rate_amount: 0, included_in_price: true) } let!(:product2) { - create(:taxed_product, zone: zone, price: 500.15, tax_rate_amount: 0.2, + create(:taxed_product, zone:, price: 500.15, tax_rate_amount: 0.2, included_in_price: true) } @@ -275,10 +275,10 @@ context "added" do let(:shipping_tax_rate_added) { - create(:tax_rate, amount: 0.10, included_in_price: false, zone: zone) + create(:tax_rate, amount: 0.10, included_in_price: false, zone:) } let(:enterprise_fee_rate_added) { - create(:tax_rate, amount: 0.15, included_in_price: false, zone: zone) + create(:tax_rate, amount: 0.15, included_in_price: false, zone:) } let(:shipping_tax_category) { create(:tax_category, tax_rates: [shipping_tax_rate_added]) } let(:fee_tax_category) { create(:tax_category, tax_rates: [enterprise_fee_rate_added]) } @@ -302,11 +302,11 @@ ship_address: address, bill_address: address) } let(:product3) { - create(:taxed_product, zone: zone, price: 12.54, tax_rate_amount: 0, + create(:taxed_product, zone:, price: 12.54, tax_rate_amount: 0, included_in_price: false) } let(:product4) { - create(:taxed_product, zone: zone, price: 500.15, tax_rate_amount: 0.2, + create(:taxed_product, zone:, price: 500.15, tax_rate_amount: 0.2, included_in_price: false) } diff --git a/spec/system/admin/order_cycles/complex_creating_specific_time_spec.rb b/spec/system/admin/order_cycles/complex_creating_specific_time_spec.rb index ef435ca1ed1..ad5c8187219 100644 --- a/spec/system/admin/order_cycles/complex_creating_specific_time_spec.rb +++ b/spec/system/admin/order_cycles/complex_creating_specific_time_spec.rb @@ -16,9 +16,9 @@ # Given coordinating, supplying and distributing enterprises with some products with variants let!(:coordinator) { create(:distributor_enterprise, name: 'My coordinator') } let!(:supplier) { create(:supplier_enterprise, name: 'My supplier') } - let!(:product) { create(:product, supplier: supplier) } - let!(:v1) { create(:variant, product: product) } - let!(:v2) { create(:variant, product: product) } + let!(:product) { create(:product, supplier:) } + let!(:v1) { create(:variant, product:) } + let!(:v2) { create(:variant, product:) } let!(:distributor) { create(:distributor_enterprise, name: 'My distributor', with_payment_and_shipping: true) } diff --git a/spec/system/admin/order_cycles/complex_updating_specific_time_spec.rb b/spec/system/admin/order_cycles/complex_updating_specific_time_spec.rb index 6edf3953e0b..3e7d02d2b3d 100644 --- a/spec/system/admin/order_cycles/complex_updating_specific_time_spec.rb +++ b/spec/system/admin/order_cycles/complex_updating_specific_time_spec.rb @@ -27,9 +27,9 @@ supplier = create(:supplier_enterprise, name: 'My supplier') distributor = create(:distributor_enterprise, name: 'My distributor', with_payment_and_shipping: true) - product = create(:product, supplier: supplier) - v1 = create(:variant, product: product) - v2 = create(:variant, product: product) + product = create(:product, supplier:) + v1 = create(:variant, product:) + v2 = create(:variant, product:) # Relationships required for interface to work create(:enterprise_relationship, parent: supplier, child: coordinator, diff --git a/spec/system/admin/order_cycles/simple_spec.rb b/spec/system/admin/order_cycles/simple_spec.rb index 9a3f576662c..29dfba4af88 100644 --- a/spec/system/admin/order_cycles/simple_spec.rb +++ b/spec/system/admin/order_cycles/simple_spec.rb @@ -376,7 +376,7 @@ name: 'Order Cycle 1' ) end let(:product) { create(:product, supplier: supplier_managed) } - let(:v1) { create(:variant, product: product ) } + let(:v1) { create(:variant, product: ) } let(:inventory_item_v1) { create(:inventory_item, enterprise: distributor_managed, variant: v1, visible: false) } @@ -596,10 +596,10 @@ let!(:v1) { p1.variants.first } let!(:v2) { p2.variants.first } let!(:v3) { p3.variants.first } - let!(:fee) { create(:enterprise_fee, enterprise: enterprise, name: 'Coord fee') } + let!(:fee) { create(:enterprise_fee, enterprise:, name: 'Coord fee') } before do - user.enterprise_roles.create! enterprise: enterprise + user.enterprise_roles.create!(enterprise:) login_as user end @@ -685,7 +685,7 @@ it "editing an order cycle" do # Given an order cycle with pickup time and instructions - fee = create(:enterprise_fee, name: 'my fee', enterprise: enterprise) + fee = create(:enterprise_fee, name: 'my fee', enterprise:) oc = create(:simple_order_cycle, suppliers: [enterprise], coordinator: enterprise, distributors: [enterprise], variants: [v1], coordinator_fees: [fee]) @@ -722,8 +722,8 @@ it "updating an order cycle" do # Given an order cycle with pickup time and instructions - fee1 = create(:enterprise_fee, name: 'my fee', enterprise: enterprise) - fee2 = create(:enterprise_fee, name: 'that fee', enterprise: enterprise) + fee1 = create(:enterprise_fee, name: 'my fee', enterprise:) + fee2 = create(:enterprise_fee, name: 'that fee', enterprise:) oc = create(:simple_order_cycle, suppliers: [enterprise], coordinator: enterprise, distributors: [enterprise], variants: [v1], coordinator_fees: [fee1]) diff --git a/spec/system/admin/order_spec.rb b/spec/system/admin/order_spec.rb index 52e28453738..bc398e76734 100644 --- a/spec/system/admin/order_spec.rb +++ b/spec/system/admin/order_spec.rb @@ -18,8 +18,8 @@ end let(:order) do - create(:order_with_totals_and_distribution, user: user, distributor: distributor, - order_cycle: order_cycle, state: 'complete', + create(:order_with_totals_and_distribution, user:, distributor:, + order_cycle:, state: 'complete', payment_state: 'balance_due') end let(:customer) { order.customer } @@ -28,7 +28,7 @@ # ensure order has a payment to capture order.finalize! - create :check_payment, order: order, amount: order.total + create :check_payment, order:, amount: order.total end def new_order_with_distribution(distributor, order_cycle) @@ -113,7 +113,7 @@ def new_order_with_distribution(distributor, order_cycle) end context "when creating an order with a customer-only" do - let!(:order) { create(:order, distributor: distributor, order_cycle: order_cycle) } + let!(:order) { create(:order, distributor:, order_cycle:) } let(:customer2) { create(:customer, enterprise: distributor) } let(:customer3) { create(:customer, enterprise: distributor) } @@ -922,8 +922,8 @@ def new_order_with_distribution(distributor, order_cycle) context "when an incomplete order has some line items with insufficient stock" do let(:incomplete_order) do - create(:order_with_line_items, user: user, distributor: distributor, - order_cycle: order_cycle) + create(:order_with_line_items, user:, distributor:, + order_cycle:) end it "displays the out of stock line items and they can be deleted from the order" do @@ -1034,8 +1034,8 @@ def serching_for_customers describe "for order states" do context "complete" do let!(:order1) { - create(:order_with_totals_and_distribution, user: user, distributor:, - order_cycle: order_cycle, state: 'complete', + create(:order_with_totals_and_distribution, user:, distributor:, + order_cycle:, state: 'complete', payment_state: 'balance_due', customer_id: customer.id) } @@ -1104,8 +1104,8 @@ def serching_for_customers context "resumed" do let!(:order2) { - create(:order_with_totals_and_distribution, user: user, distributor:, - order_cycle: order_cycle, state: 'resumed', + create(:order_with_totals_and_distribution, user:, distributor:, + order_cycle:, state: 'resumed', payment_state: 'balance_due') } before do @@ -1120,8 +1120,8 @@ def serching_for_customers context "canceled" do let!(:order3) { - create(:order_with_totals_and_distribution, user: user, distributor:, - order_cycle: order_cycle, state: 'canceled', + create(:order_with_totals_and_distribution, user:, distributor:, + order_cycle:, state: 'canceled', payment_state: 'balance_due') } before do @@ -1136,7 +1136,7 @@ def serching_for_customers context "cart" do let!(:order_empty) { - create(:order_with_line_items, user: user, distributor:, order_cycle: order_cycle, + create(:order_with_line_items, user:, distributor:, order_cycle:, line_items_count: 0) } before do @@ -1151,8 +1151,8 @@ def serching_for_customers context "payment" do let!(:order4) do - create(:order_ready_for_payment, user: user, distributor: distributor, - order_cycle: order_cycle, + create(:order_ready_for_payment, user:, distributor:, + order_cycle:, payment_state: 'balance_due') end before do diff --git a/spec/system/admin/orders_spec.rb b/spec/system/admin/orders_spec.rb index f30e624ed2b..78ac3ba5b5c 100644 --- a/spec/system/admin/orders_spec.rb +++ b/spec/system/admin/orders_spec.rb @@ -23,16 +23,16 @@ let(:billing_address5) { create(:address, :randomized) } let(:product) { create(:simple_product) } let(:distributor) { - create(:distributor_enterprise, owner: owner, with_payment_and_shipping: true, + create(:distributor_enterprise, owner:, with_payment_and_shipping: true, charges_sales_tax: true) } - let(:distributor2) { create(:distributor_enterprise_with_tax, owner: owner) } + let(:distributor2) { create(:distributor_enterprise_with_tax, owner:) } let(:distributor3) { - create(:distributor_enterprise, owner: owner, with_payment_and_shipping: true, + create(:distributor_enterprise, owner:, with_payment_and_shipping: true, charges_sales_tax: true) } let(:distributor4) { - create(:distributor_enterprise, owner: owner, with_payment_and_shipping: true, + create(:distributor_enterprise, owner:, with_payment_and_shipping: true, charges_sales_tax: true) } let(:distributor5) { create(:distributor_enterprise, owner: owner2, charges_sales_tax: true) } @@ -52,8 +52,8 @@ context "with a complete order" do let(:order) do - create(:order_with_totals_and_distribution, user: customer, distributor: distributor, - order_cycle: order_cycle, + create(:order_with_totals_and_distribution, user: customer, distributor:, + order_cycle:, state: 'complete', payment_state: 'balance_due', bill_address_id: billing_address.id) end @@ -691,7 +691,7 @@ context "with a capturable order" do before do order.finalize! # ensure order has a payment to capture - order.payments << create(:check_payment, order: order, amount: order.total) + order.payments << create(:check_payment, order:, amount: order.total) end it "capture payment" do @@ -766,8 +766,8 @@ context "with incomplete order" do it "can edit order" do - incomplete_order = create(:order_with_line_items, distributor: distributor, - order_cycle: order_cycle, + incomplete_order = create(:order_with_line_items, distributor:, + order_cycle:, line_items_count: 1) login_as_admin @@ -783,13 +783,13 @@ context "test the 'Only show the complete orders' checkbox" do it "display or not incomplete order" do - incomplete_order = create(:order_with_line_items, distributor: distributor, - order_cycle: order_cycle, + incomplete_order = create(:order_with_line_items, distributor:, + order_cycle:, line_items_count: 1) complete_order = create( :order_with_line_items, - distributor: distributor, - order_cycle: order_cycle, + distributor:, + order_cycle:, user: customer, state: 'complete', payment_state: 'balance_due', @@ -799,8 +799,8 @@ empty_complete_order = create( :order_with_line_items, - distributor: distributor, - order_cycle: order_cycle, + distributor:, + order_cycle:, user: customer, state: 'complete', payment_state: 'balance_due', @@ -808,7 +808,7 @@ line_items_count: 0 ) - empty_order = create(:order, distributor: distributor, order_cycle: order_cycle) + empty_order = create(:order, distributor:, order_cycle:) login_as_admin visit spree.admin_orders_path @@ -832,9 +832,9 @@ let!(:order) do create( :order, - distributor: distributor, - order_cycle: order_cycle, - user: user, + distributor:, + order_cycle:, + user:, number: "R123456", state: 'complete', payment_state: 'balance_due', diff --git a/spec/system/admin/payments_stripe_spec.rb b/spec/system/admin/payments_stripe_spec.rb index c14d000a77a..b9c87747083 100644 --- a/spec/system/admin/payments_stripe_spec.rb +++ b/spec/system/admin/payments_stripe_spec.rb @@ -33,10 +33,10 @@ context "for a complete order" do context "with a card that succeeds on card registration" do - before { stub_payment_intents_post_request order: order, stripe_account_header: true } + before { stub_payment_intents_post_request order:, stripe_account_header: true } context "and succeeds on payment capture" do - before { stub_successful_capture_request order: order } + before { stub_successful_capture_request order: } it "adds a payment with state complete" do login_as_admin @@ -54,7 +54,7 @@ context "but fails on payment capture" do let(:error_message) { "Card was declined: insufficient funds." } - before { stub_failed_capture_request order: order, response: { message: error_message } } + before { stub_failed_capture_request order:, response: { message: error_message } } it "fails to add a payment due to card error" do login_as_admin @@ -73,7 +73,7 @@ context "with a card that fails on registration because it requires(redirects) extra auth" do before do - stub_payment_intents_post_request_with_redirect order: order, + stub_payment_intents_post_request_with_redirect order:, redirect_url: "https://www.stripe.com/authorize" end @@ -97,8 +97,8 @@ let!(:order) { create(:order_with_line_items, distributor: create(:enterprise)) } before do - stub_payment_intents_post_request order: order, stripe_account_header: true - stub_successful_capture_request order: order + stub_payment_intents_post_request order:, stripe_account_header: true + stub_successful_capture_request(order:) break unless order.next! while !order.payment? end @@ -120,7 +120,7 @@ context "with a payment using a StripeSCA payment method" do before do order.update payments: [] - order.payments << create(:payment, payment_method: stripe_payment_method, order: order) + order.payments << create(:payment, payment_method: stripe_payment_method, order:) end it "renders the payment details" do diff --git a/spec/system/admin/reports/enterprise_fee_summaries_spec.rb b/spec/system/admin/reports/enterprise_fee_summaries_spec.rb index 581281120ba..39e8a387e7b 100644 --- a/spec/system/admin/reports/enterprise_fee_summaries_spec.rb +++ b/spec/system/admin/reports/enterprise_fee_summaries_spec.rb @@ -67,8 +67,8 @@ context "when logged in as enterprise user" do let!(:order) do - create(:completed_order_with_fees, order_cycle: order_cycle, - distributor: distributor) + create(:completed_order_with_fees, order_cycle:, + distributor:) end let(:current_user) { distributor.owner } @@ -82,8 +82,8 @@ describe "smoke test for generation of report based on permissions" do context "when logged in as admin" do let!(:order) do - create(:completed_order_with_fees, order_cycle: order_cycle, - distributor: distributor) + create(:completed_order_with_fees, order_cycle:, + distributor:) end let(:current_user) { create(:admin_user) } @@ -101,8 +101,8 @@ context "when logged in as enterprise user" do let!(:order) do - create(:completed_order_with_fees, order_cycle: order_cycle, - distributor: distributor) + create(:completed_order_with_fees, order_cycle:, + distributor:) end let!(:other_order) do create(:completed_order_with_fees, order_cycle: other_order_cycle, @@ -130,8 +130,8 @@ let!(:second_order_cycle) { create(:simple_order_cycle, coordinator: second_distributor) } let!(:order) do - create(:completed_order_with_fees, order_cycle: order_cycle, - distributor: distributor) + create(:completed_order_with_fees, order_cycle:, + distributor:) end let!(:second_order) do create(:completed_order_with_fees, order_cycle: second_order_cycle, diff --git a/spec/system/admin/reports/enterprise_summary_fees/enterprise_summary_fee_with_tax_report_by_order_spec.rb b/spec/system/admin/reports/enterprise_summary_fees/enterprise_summary_fee_with_tax_report_by_order_spec.rb index 11f2fe8b5ac..13eea4aa194 100644 --- a/spec/system/admin/reports/enterprise_summary_fees/enterprise_summary_fee_with_tax_report_by_order_spec.rb +++ b/spec/system/admin/reports/enterprise_summary_fees/enterprise_summary_fee_with_tax_report_by_order_spec.rb @@ -36,10 +36,10 @@ let!(:country_zone){ create(:zone_with_member) } let!(:tax_category){ create(:tax_category, name: 'tax_category') } let!(:state_tax_rate){ - create(:tax_rate, zone: state_zone, tax_category: tax_category, name: 'State', amount: 0.015) + create(:tax_rate, zone: state_zone, tax_category:, name: 'State', amount: 0.015) } let!(:country_tax_rate){ - create(:tax_rate, zone: country_zone, tax_category: tax_category, name: 'Country', + create(:tax_rate, zone: country_zone, tax_category:, name: 'Country', amount: 0.025) } let!(:ship_address){ create(:ship_address) } @@ -51,7 +51,7 @@ let!(:payment_method){ create(:payment_method, :flat_rate) } let!(:shipping_method){ create(:shipping_method, :flat_rate) } - let!(:order){ create(:order_with_distributor, distributor: distributor, number: order_number) } + let!(:order){ create(:order_with_distributor, distributor:, number: order_number) } let!(:order_cycle){ create(:simple_order_cycle, name: "oc1", suppliers: [supplier], distributors: [distributor], variants: [variant]) @@ -63,19 +63,19 @@ create(:enterprise_fee, :flat_rate, enterprise: distributor, amount: 20, name: 'Adminstration', fee_type: 'admin', - tax_category: tax_category) + tax_category:) } let!(:supplier_fees){ create(:enterprise_fee, :flat_rate, enterprise: supplier, amount: 15, name: 'Transport', fee_type: 'transport', - tax_category: tax_category) + tax_category:) } let!(:distributor_fee){ create(:enterprise_fee, :flat_rate, enterprise: distributor, amount: 10, name: 'Packing', fee_type: 'packing', - tax_category: tax_category) + tax_category:) } let!(:customer_first_name){ "Customer First Name" } @@ -100,7 +100,7 @@ context 'added tax' do before do - order.line_items.create({ variant: variant, quantity: 1, price: 100 }) + order.line_items.create({ variant:, quantity: 1, price: 100 }) order.update!({ order_cycle_id: order_cycle.id, ship_address_id: ship_address.id @@ -183,7 +183,7 @@ state_tax_rate.update!({ included_in_price: true }) country_tax_rate.update!({ included_in_price: true }) - order.line_items.create({ variant: variant, quantity: 1, price: 100 }) + order.line_items.create({ variant:, quantity: 1, price: 100 }) order.update!({ order_cycle_id: order_cycle.id, ship_address_id: ship_address.id diff --git a/spec/system/admin/reports/orders_and_fulfillment_spec.rb b/spec/system/admin/reports/orders_and_fulfillment_spec.rb index 1f8ec4931d9..bcd3e9e5fc0 100644 --- a/spec/system/admin/reports/orders_and_fulfillment_spec.rb +++ b/spec/system/admin/reports/orders_and_fulfillment_spec.rb @@ -25,19 +25,19 @@ } let(:order_cycle) { create(:simple_order_cycle, distributors: [distributor]) } let(:order1) { - create(:completed_order_with_totals, line_items_count: 0, distributor: distributor, + create(:completed_order_with_totals, line_items_count: 0, distributor:, bill_address: bill_address1, order_cycle_id: order_cycle.id) } let(:order2) { - create(:completed_order_with_totals, line_items_count: 0, distributor: distributor, + create(:completed_order_with_totals, line_items_count: 0, distributor:, bill_address: bill_address2, order_cycle_id: order_cycle.id) } let(:supplier) { create(:supplier_enterprise, name: "Supplier Name") } - let(:product) { create(:simple_product, name: "Baked Beans", supplier: supplier ) } - let(:variant1) { create(:variant, product: product, unit_description: "Big") } - let(:variant2) { create(:variant, product: product, unit_description: "Small") } + let(:product) { create(:simple_product, name: "Baked Beans", supplier: ) } + let(:variant1) { create(:variant, product:, unit_description: "Big") } + let(:variant2) { create(:variant, product:, unit_description: "Small") } before do # order1 has two line items / variants @@ -153,12 +153,12 @@ let(:bill_address4) { create(:address, firstname: "Ave", lastname: "Zebu") } let(:order3) { create(:completed_order_with_totals, line_items_count: 0, - distributor: distributor, + distributor:, bill_address: bill_address3) } let(:order4) { create(:completed_order_with_totals, line_items_count: 0, - distributor: distributor, + distributor:, bill_address: bill_address4) } @@ -178,7 +178,7 @@ end context "When filtering by product" do - let(:variant1) { create(:variant, product: product, unit_description: "Big") } + let(:variant1) { create(:variant, product:, unit_description: "Big") } let(:variant3) { create(:variant) } before do @@ -212,7 +212,7 @@ context "for three different orders" do let(:order3) { create(:completed_order_with_totals, line_items_count: 0, - distributor: distributor, + distributor:, bill_address: bill_address1, order_cycle_id: order_cycle.id) } @@ -403,7 +403,7 @@ let(:product2) { create(:simple_product, name: "Salted Peanuts", supplier: supplier2 ) } let(:variant3) { create(:variant, product: product2, unit_description: "Bag") } let(:order4) { - create(:completed_order_with_totals, line_items_count: 0, distributor: distributor, + create(:completed_order_with_totals, line_items_count: 0, distributor:, bill_address: bill_address1, order_cycle_id: order_cycle.id) } diff --git a/spec/system/admin/reports/packing_report_spec.rb b/spec/system/admin/reports/packing_report_spec.rb index da86e57936b..644684fb19f 100644 --- a/spec/system/admin/reports/packing_report_spec.rb +++ b/spec/system/admin/reports/packing_report_spec.rb @@ -26,18 +26,18 @@ } let(:distributor) { create(:distributor_enterprise, address: distributor_address) } let(:order1) { - create(:completed_order_with_totals, line_items_count: 0, distributor: distributor, + create(:completed_order_with_totals, line_items_count: 0, distributor:, bill_address: bill_address1) } let(:order2) { - create(:completed_order_with_totals, line_items_count: 0, distributor: distributor, + create(:completed_order_with_totals, line_items_count: 0, distributor:, bill_address: bill_address2) } let(:supplier) { create(:supplier_enterprise, name: "Supplier") } - let(:product1) { create(:simple_product, name: "Product 1", supplier: supplier ) } + let(:product1) { create(:simple_product, name: "Product 1", supplier: ) } let(:variant1) { create(:variant, product: product1, unit_description: "Big") } let(:variant2) { create(:variant, product: product1, unit_description: "Small") } - let(:product2) { create(:simple_product, name: "Product 2", supplier: supplier) } + let(:product2) { create(:simple_product, name: "Product 2", supplier:) } before do order1.finalize! @@ -115,7 +115,7 @@ let(:oc) { create(:simple_order_cycle) } let(:order) { create(:completed_order_with_totals, line_items_count: 0, - order_cycle: oc, distributor: distributor) + order_cycle: oc, distributor:) } let(:li1) { build(:line_item_with_shipment) } let(:li2) { build(:line_item_with_shipment) } diff --git a/spec/system/admin/reports/payments_report_spec.rb b/spec/system/admin/reports/payments_report_spec.rb index 9eee087b1a7..b4e8cb0bff4 100644 --- a/spec/system/admin/reports/payments_report_spec.rb +++ b/spec/system/admin/reports/payments_report_spec.rb @@ -10,7 +10,7 @@ :order_with_distributor, state: 'complete', completed_at: Time.zone.now, - order_cycle: order_cycle + order_cycle: ) end let(:other_order) do @@ -18,17 +18,17 @@ :order_with_distributor, state: 'complete', completed_at: Time.zone.now, - order_cycle: order_cycle, + order_cycle:, distributor: order.distributor ) end let(:order_cycle) { create(:simple_order_cycle) } - let(:product) { create(:product, supplier: supplier) } + let(:product) { create(:product, supplier:) } let(:supplier) { create(:supplier_enterprise) } before do - create(:line_item_with_shipment, order: order, product: product) - create(:line_item_with_shipment, order: other_order, product: product) + create(:line_item_with_shipment, order:, product:) + create(:line_item_with_shipment, order: other_order, product:) login_as_admin visit admin_reports_path @@ -62,7 +62,7 @@ context 'when choosing payment totals report type' do let(:paypal) { create(:payment_method, name: "PayPal") } let!(:paypal_payment) { - create(:payment, order: order, payment_method: paypal, state: "completed", amount: 5) + create(:payment, order:, payment_method: paypal, state: "completed", amount: 5) } let(:eft) { create(:payment_method, name: "EFT") } diff --git a/spec/system/admin/reports/revenues_by_hub_spec.rb b/spec/system/admin/reports/revenues_by_hub_spec.rb index 901fc65a4ca..9d622ec355c 100644 --- a/spec/system/admin/reports/revenues_by_hub_spec.rb +++ b/spec/system/admin/reports/revenues_by_hub_spec.rb @@ -9,17 +9,17 @@ create( :completed_order_with_totals, completed_at: 2.days.ago, - order_cycle: order_cycle, + order_cycle:, distributor: create(:enterprise, name: "Hub 1", owner: create(:user, email: "email@email.com")), ) end let(:order_cycle) { create(:simple_order_cycle) } - let(:product) { create(:product, supplier: supplier) } + let(:product) { create(:product, supplier:) } let(:supplier) { create(:supplier_enterprise) } before do - create(:line_item_with_shipment, order: order, product: product) + create(:line_item_with_shipment, order:, product:) login_as_admin visit main_app.admin_report_path(report_type: 'revenues_by_hub') diff --git a/spec/system/admin/reports/sales_tax/sales_tax_totals_by_order_spec.rb b/spec/system/admin/reports/sales_tax/sales_tax_totals_by_order_spec.rb index 20664687c61..98bd05412ff 100644 --- a/spec/system/admin/reports/sales_tax/sales_tax_totals_by_order_spec.rb +++ b/spec/system/admin/reports/sales_tax/sales_tax_totals_by_order_spec.rb @@ -32,11 +32,11 @@ let!(:country_zone){ create(:zone_with_member) } let!(:tax_category){ create(:tax_category, name: 'GST Food') } let!(:state_tax_rate){ - create(:tax_rate, zone: state_zone, tax_category: tax_category, + create(:tax_rate, zone: state_zone, tax_category:, name: 'State', amount: 0.015) } let!(:country_tax_rate){ - create(:tax_rate, zone: country_zone, tax_category: tax_category, + create(:tax_rate, zone: country_zone, tax_category:, name: 'Country', amount: 0.025) } let!(:ship_address){ @@ -64,7 +64,7 @@ create(:shipping_method, :flat_rate, amount: 10, tax_category_id: tax_category.id) } - let!(:order){ create(:order_with_distributor, distributor: distributor) } + let!(:order){ create(:order_with_distributor, distributor:) } let!(:order_cycle){ create(:simple_order_cycle, name: 'oc1', suppliers: [supplier], distributors: [distributor], variants: [variant]) @@ -92,7 +92,7 @@ customer_id: customer1.id, email: 'order1@example.com' ) - order.line_items.create(variant: variant, quantity: 1, price: 100) + order.line_items.create(variant:, quantity: 1, price: 100) end context 'added tax' do @@ -221,7 +221,7 @@ end context 'should filter by customer' do - let!(:order2){ create(:order_with_distributor, distributor: distributor) } + let!(:order2){ create(:order_with_distributor, distributor:) } let!(:customer2){ create(:customer, enterprise: create(:enterprise), user: create(:user)) } let!(:customer_email_dropdown_selector){ "#s2id_q_customer_id_in" } let!(:table_raw_selector){ "table.report__table tbody tr" } @@ -324,7 +324,7 @@ OrderWorkflow.new(order).complete! customer2.update!({ first_name: 'c2fname', last_name: 'c2lname', code: 'DEF456' }) - order2.line_items.create({ variant: variant, quantity: 1, price: 200 }) + order2.line_items.create({ variant:, quantity: 1, price: 200 }) order2.update!({ order_cycle_id: order_cycle.id, ship_address_id: customer2.bill_address_id, diff --git a/spec/system/admin/reports/sales_tax/sales_tax_totals_by_producer_spec.rb b/spec/system/admin/reports/sales_tax/sales_tax_totals_by_producer_spec.rb index 9a1a9053d1c..d72ae517890 100644 --- a/spec/system/admin/reports/sales_tax/sales_tax_totals_by_producer_spec.rb +++ b/spec/system/admin/reports/sales_tax/sales_tax_totals_by_producer_spec.rb @@ -27,8 +27,8 @@ let!(:state_zone){ create(:zone_with_state_member) } let!(:country_zone){ create(:zone_with_member) } let!(:tax_category){ create(:tax_category) } - let!(:state_tax_rate){ create(:tax_rate, zone: state_zone, tax_category: tax_category) } - let!(:country_tax_rate){ create(:tax_rate, zone: country_zone, tax_category: tax_category) } + let!(:state_tax_rate){ create(:tax_rate, zone: state_zone, tax_category:) } + let!(:country_tax_rate){ create(:tax_rate, zone: country_zone, tax_category:) } let!(:ship_address){ create(:ship_address) } let!(:variant){ create(:variant) } @@ -38,7 +38,7 @@ let!(:payment_method){ create(:payment_method, :flat_rate) } let!(:shipping_method){ create(:shipping_method, :flat_rate) } - let!(:order){ create(:order_with_distributor, distributor: distributor) } + let!(:order){ create(:order_with_distributor, distributor:) } let!(:order_cycle){ create(:simple_order_cycle, suppliers: [supplier], distributors: [distributor], variants: [variant]) @@ -63,7 +63,7 @@ context 'added tax' do before do - order.line_items.create({ variant: variant, quantity: 1, price: 100 }) + order.line_items.create({ variant:, quantity: 1, price: 100 }) order.update!({ order_cycle_id: order_cycle.id, ship_address_id: ship_address.id @@ -125,7 +125,7 @@ state_tax_rate.update!({ included_in_price: true }) country_tax_rate.update!({ included_in_price: true }) - order.line_items.create({ variant: variant, quantity: 1, price: 100 }) + order.line_items.create({ variant:, quantity: 1, price: 100 }) order.update!({ order_cycle_id: order_cycle.id, ship_address_id: ship_address.id @@ -182,7 +182,7 @@ end context 'should filter by customer' do - let!(:order2){ create(:order_with_distributor, distributor: distributor) } + let!(:order2){ create(:order_with_distributor, distributor:) } let!(:customer1){ create(:customer, enterprise: create(:enterprise), user: create(:user)) } let!(:customer2){ create(:customer, enterprise: create(:enterprise), user: create(:user)) } let!(:customer_email_dropdown_selector){ "#s2id_q_customer_id_in" } @@ -304,7 +304,7 @@ } before do - order.line_items.create({ variant: variant, quantity: 1, price: 100 }) + order.line_items.create({ variant:, quantity: 1, price: 100 }) order.update!({ order_cycle_id: order_cycle.id, ship_address_id: customer1.bill_address_id, @@ -314,7 +314,7 @@ break unless order.next! end - order2.line_items.create({ variant: variant, quantity: 1, price: 200 }) + order2.line_items.create({ variant:, quantity: 1, price: 200 }) order2.update!({ order_cycle_id: order_cycle.id, ship_address_id: customer2.bill_address_id,