mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-03 22:06:07 +00:00
todo: make specs work with admin_style_v3
This commit is contained in:
@@ -8,11 +8,6 @@ RSpec.describe "Product Import" do
|
||||
include AuthenticationHelper
|
||||
include WebHelper
|
||||
|
||||
around do |example|
|
||||
Flipper.disable(:admin_style_v3)
|
||||
example.run
|
||||
end
|
||||
|
||||
let!(:admin) { create(:admin_user) }
|
||||
let!(:user) { create(:user) }
|
||||
let!(:user2) { create(:user) }
|
||||
@@ -101,6 +96,8 @@ RSpec.describe "Product Import" do
|
||||
|
||||
wait_until { page.find("a.button.view").present? }
|
||||
|
||||
puts "TODO: migrate to v3"
|
||||
Flipper.disable(:admin_style_v3) # disabling BUU for legacy products page
|
||||
click_link 'Go To Products Page'
|
||||
|
||||
expect(page).to have_content 'Bulk Edit Products'
|
||||
@@ -213,6 +210,8 @@ RSpec.describe "Product Import" do
|
||||
potatoes = Spree::Product.find_by(name: 'Potatoes')
|
||||
expect(potatoes.variants.first.import_date).to be_within(1.minute).of Time.zone.now
|
||||
|
||||
puts "TODO: migrate to v3"
|
||||
Flipper.disable(:admin_style_v3) # disabling BUU for legacy products page
|
||||
click_link 'Go To Products Page'
|
||||
|
||||
wait_until { page.find("#p_#{carrots.id}").present? }
|
||||
@@ -677,6 +676,8 @@ RSpec.describe "Product Import" do
|
||||
expect(page).to have_selector '.created-count', text: '2'
|
||||
expect(page).not_to have_selector '.updated-count'
|
||||
|
||||
puts "TODO: migrate to v3"
|
||||
Flipper.disable(:admin_style_v3) # disabling BUU for legacy products page
|
||||
visit spree.admin_products_path
|
||||
|
||||
within "#p_#{Spree::Product.find_by(name: 'Carrots').id}" do
|
||||
@@ -713,9 +714,11 @@ RSpec.describe "Product Import" do
|
||||
expect(page).to have_selector '.created-count', text: '1'
|
||||
|
||||
expect(page).not_to have_selector '.updated-count'
|
||||
expect(page).to have_content "Go To Products Page".upcase
|
||||
expect(page).to have_content "Upload Another File".upcase
|
||||
expect(page).to have_content "Go To Products Page"
|
||||
expect(page).to have_content "Upload Another File"
|
||||
|
||||
puts "TODO: migrate to v3"
|
||||
Flipper.disable(:admin_style_v3) # disabling BUU for legacy products page
|
||||
visit spree.admin_products_path
|
||||
|
||||
within "#p_#{Spree::Product.find_by(name: 'Cupcake').id}" do
|
||||
@@ -787,7 +790,7 @@ RSpec.describe "Product Import" do
|
||||
|
||||
product_headings.each do |heading|
|
||||
expect(page).to have_content(
|
||||
I18n.t("admin.product_import.product_headings.#{heading}").upcase
|
||||
I18n.t("admin.product_import.product_headings.#{heading}")
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -280,11 +280,8 @@ RSpec.describe '
|
||||
end
|
||||
end
|
||||
|
||||
describe "legacy products page" do
|
||||
around do |example|
|
||||
Flipper.disable(:admin_style_v3)
|
||||
example.run
|
||||
end
|
||||
describe "legacy products page (TODO: migrate/combine specs with v3 specs)" do
|
||||
before { Flipper.disable(:admin_style_v3) }
|
||||
|
||||
describe "deleting" do
|
||||
let!(:product1) { create(:simple_product, name: 'a product to keep', supplier: @supplier) }
|
||||
|
||||
@@ -237,6 +237,7 @@ RSpec.describe 'Subscriptions' do
|
||||
expect(page).to have_selector "#subscription-line-items .item", count: 4
|
||||
|
||||
# Delete an existing product
|
||||
puts "TODO: migrate to v3" # but first we need to make the actions menu more accessible.
|
||||
Flipper.disable(:admin_style_v3) # disabling BUU for legacy products page
|
||||
login_as_admin
|
||||
visit spree.admin_products_path
|
||||
|
||||
Reference in New Issue
Block a user