diff --git a/admin/lib/solidus_admin/testing_support/feature_helpers.rb b/admin/lib/solidus_admin/testing_support/feature_helpers.rb index e8dfa7c54f7..c69d1ec95dd 100644 --- a/admin/lib/solidus_admin/testing_support/feature_helpers.rb +++ b/admin/lib/solidus_admin/testing_support/feature_helpers.rb @@ -22,6 +22,10 @@ def find_row(text) find('table tbody tr', text:) end + def click_row(text) + find('table tbody tr td', text: text).click + end + def find_row_checkbox(text) find_row(text).find('td:first-child input[type="checkbox"]') end diff --git a/promotions/lib/components/admin/solidus_promotions/promotions/index/component.rb b/promotions/lib/components/admin/solidus_promotions/promotions/index/component.rb index 4d64c3164e9..772a5180a26 100644 --- a/promotions/lib/components/admin/solidus_promotions/promotions/index/component.rb +++ b/promotions/lib/components/admin/solidus_promotions/promotions/index/component.rb @@ -14,7 +14,7 @@ def search_url end def row_url(promotion) - solidus_promotions.admin_promotion_path(promotion) + solidus_promotions.edit_admin_promotion_path(promotion) end def page_actions diff --git a/promotions/spec/system/solidus_promotions/admin/promotions_spec.rb b/promotions/spec/system/solidus_promotions/admin/promotions_spec.rb index b49bbd94d37..a0d381c78cf 100644 --- a/promotions/spec/system/solidus_promotions/admin/promotions_spec.rb +++ b/promotions/spec/system/solidus_promotions/admin/promotions_spec.rb @@ -32,5 +32,9 @@ expect(page).to have_content("Promotions were successfully removed.") expect(page).not_to have_content("My active Promotion") expect(SolidusPromotions::Promotion.count).to eq(3) + + click_row("My future Promotion") + expect(page).to have_content("My future Promotion") + expect(page).to have_content("Starts at") end end