diff --git a/spec/base_spec_helper.rb b/spec/base_spec_helper.rb index 4595c8db2c..34e3e51003 100644 --- a/spec/base_spec_helper.rb +++ b/spec/base_spec_helper.rb @@ -7,6 +7,7 @@ ENV["RAILS_ENV"] ||= 'test' require 'simplecov' if ENV["COVERAGE"] require 'rubygems' require 'pry' unless ENV['CI'] +require 'view_component/test_helpers' require_relative "../config/environment" require 'rspec/rails' diff --git a/spec/features/admin/multilingual_spec.rb b/spec/system/admin/multilingual_spec.rb similarity index 98% rename from spec/features/admin/multilingual_spec.rb rename to spec/system/admin/multilingual_spec.rb index 6336338b61..0f23f089d5 100644 --- a/spec/features/admin/multilingual_spec.rb +++ b/spec/system/admin/multilingual_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'spec_helper' +require 'system_helper' describe 'Multilingual', js: true do include AuthenticationHelper diff --git a/spec/features/admin/order_cycles_complex_nav_check_spec.rb b/spec/system/admin/order_cycles_complex_nav_check_spec.rb similarity index 97% rename from spec/features/admin/order_cycles_complex_nav_check_spec.rb rename to spec/system/admin/order_cycles_complex_nav_check_spec.rb index b33dfc2e1b..bbf08caf0a 100644 --- a/spec/features/admin/order_cycles_complex_nav_check_spec.rb +++ b/spec/system/admin/order_cycles_complex_nav_check_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'spec_helper' +require 'system_helper' describe ' As an administrator diff --git a/spec/features/admin/order_print_ticket_spec.rb b/spec/system/admin/order_print_ticket_spec.rb similarity index 99% rename from spec/features/admin/order_print_ticket_spec.rb rename to spec/system/admin/order_print_ticket_spec.rb index 07f069b2fc..f4dbc1be2e 100644 --- a/spec/features/admin/order_print_ticket_spec.rb +++ b/spec/system/admin/order_print_ticket_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require "spec_helper" +require "system_helper" describe ' As an administrator diff --git a/spec/features/admin/order_spec.rb b/spec/system/admin/order_spec.rb similarity index 99% rename from spec/features/admin/order_spec.rb rename to spec/system/admin/order_spec.rb index 8cad382463..a77fe8a47c 100644 --- a/spec/features/admin/order_spec.rb +++ b/spec/system/admin/order_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require "spec_helper" +require "system_helper" describe ' As an administrator @@ -90,7 +90,7 @@ describe ' select2_select product.name, from: 'add_variant_id', search: true find('button.add_variant').click - + page.has_selector? "table.index tbody[data-hook='admin_order_form_line_items'] tr" # Wait for JS expect(page).to have_selector 'td', text: product.name expect(order.line_items.reload.map(&:product)).to include product end diff --git a/spec/features/admin/overview_spec.rb b/spec/system/admin/overview_spec.rb similarity index 99% rename from spec/features/admin/overview_spec.rb rename to spec/system/admin/overview_spec.rb index c25243444e..9c3ed18d1d 100644 --- a/spec/features/admin/overview_spec.rb +++ b/spec/system/admin/overview_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'spec_helper' +require 'system_helper' describe ' As a backend user diff --git a/spec/features/admin/payment_method_spec.rb b/spec/system/admin/payment_method_spec.rb similarity index 99% rename from spec/features/admin/payment_method_spec.rb rename to spec/system/admin/payment_method_spec.rb index 41ba0af000..c741c4849d 100644 --- a/spec/features/admin/payment_method_spec.rb +++ b/spec/system/admin/payment_method_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require "spec_helper" +require "system_helper" describe ' As a Super Admin diff --git a/spec/features/admin/payments_spec.rb b/spec/system/admin/payments_spec.rb similarity index 98% rename from spec/features/admin/payments_spec.rb rename to spec/system/admin/payments_spec.rb index a916ccd804..66262e786a 100644 --- a/spec/features/admin/payments_spec.rb +++ b/spec/system/admin/payments_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'spec_helper' +require 'system_helper' describe ' As an admin diff --git a/spec/features/admin/payments_stripe_spec.rb b/spec/system/admin/payments_stripe_spec.rb similarity index 99% rename from spec/features/admin/payments_stripe_spec.rb rename to spec/system/admin/payments_stripe_spec.rb index b81fe65308..7852fbfcda 100644 --- a/spec/features/admin/payments_stripe_spec.rb +++ b/spec/system/admin/payments_stripe_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require 'spec_helper' +require 'system_helper' describe ' As an hub manager diff --git a/spec/features/admin/product_import_spec.rb b/spec/system/admin/product_import_spec.rb similarity index 99% rename from spec/features/admin/product_import_spec.rb rename to spec/system/admin/product_import_spec.rb index 36a280f06a..eb98a1c3fc 100644 --- a/spec/features/admin/product_import_spec.rb +++ b/spec/system/admin/product_import_spec.rb @@ -1,6 +1,6 @@ # frozen_string_literal: false -require 'spec_helper' +require 'system_helper' require 'open_food_network/permissions' describe "Product Import", js: true do @@ -661,7 +661,7 @@ describe "Product Import", js: true do let!(:tax_category) { create(:tax_category, name: "Tax Category Name") } let!(:shipping_category) { create(:shipping_category, name: "Shipping Category Name") } - let!(:csv_file) { file_fixture('sample_file_120_products.csv') } + let!(:csv_file) { Rails.root.join('spec/fixtures/files/sample_file_120_products.csv') } before do login_as admin @@ -715,7 +715,7 @@ describe "Product Import", js: true do def expect_progress_percentages(*percentages) percentages.each do |percentage| - expect(page).to have_selector ".progress-interface", text: percentage + page.has_selector? ".progress-interface", text: percentage # Waits for progress bar end end