From e565243ce420b3da0cfd3ab1bd5e863c8c1e2c5f Mon Sep 17 00:00:00 2001 From: David Cook Date: Tue, 24 Feb 2026 15:57:44 +1100 Subject: [PATCH] Remove unnecessary before action Each context has different setup and needs to load the page after setup. --- spec/system/admin/products_v3/index_spec.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/spec/system/admin/products_v3/index_spec.rb b/spec/system/admin/products_v3/index_spec.rb index 3658dbc726..e74517262f 100644 --- a/spec/system/admin/products_v3/index_spec.rb +++ b/spec/system/admin/products_v3/index_spec.rb @@ -35,11 +35,9 @@ RSpec.describe 'As an enterprise user, I can browse my products' do let!(:p1) { create(:product, name: "Product1") } let!(:p2) { create(:product, name: "Product2") } - before do - visit admin_products_url - end - it "displays a list of products" do + visit admin_products_path + within ".products" do # displays table header expect(page).to have_selector "th", text: "Name"