From 0f3b29954427e4f0c3fa3563b8c68a9700e8cd0b Mon Sep 17 00:00:00 2001 From: David Cook Date: Tue, 10 Feb 2026 11:30:57 +1100 Subject: [PATCH] Clean up spec There's no "COPY OF" product in the spec setup, so we don't need to check that it's not there. (unless maybe we added that to the product factory, but it seems unlikely). Also we can use helper method. --- spec/system/admin/products_v3/actions_spec.rb | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/spec/system/admin/products_v3/actions_spec.rb b/spec/system/admin/products_v3/actions_spec.rb index 161955279b..53079771df 100644 --- a/spec/system/admin/products_v3/actions_spec.rb +++ b/spec/system/admin/products_v3/actions_spec.rb @@ -246,24 +246,12 @@ RSpec.describe 'As an enterprise user, I can perform actions on the products scr describe "Cloning product" do it "shows the cloned product on page when clicked on the cloned option" do - # TODO, variant supplier missing, needs to be copied from variant and not product - within "table.products" do - # Gather input values, because page.content doesn't include them. - input_content = page.find_all('input[type=text]').map(&:value).join - - # Products does not include the cloned product. - expect(input_content).not_to match /COPY OF Apples/ - end - click_product_clone "Apples" expect(page).to have_content "Successfully cloned the product" within "table.products" do - # Gather input values, because page.content doesn't include them. - input_content = page.find_all('input[type=text]').map(&:value).join - - # Products include the cloned product. - expect(input_content).to match /COPY OF Apples/ + # Product list includes the cloned product. + expect(all_input_values).to match /COPY OF Apples/ end end end