From ce1bd127602070755588cb137aa4eef5e15648c3 Mon Sep 17 00:00:00 2001 From: David Cook Date: Tue, 4 Apr 2023 16:25:10 +1000 Subject: [PATCH] Consolidate specs It takes time to set up this test case. Given that there's no interactions in the expectations, we should save time to generate it only once. --- spec/system/admin/payment_method_spec.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/spec/system/admin/payment_method_spec.rb b/spec/system/admin/payment_method_spec.rb index dd35e75471..98f852edb6 100644 --- a/spec/system/admin/payment_method_spec.rb +++ b/spec/system/admin/payment_method_spec.rb @@ -403,17 +403,14 @@ describe ' Spree::Preferences::Store.instance.persistence = false end - it "displays the number of errors" do + it "displays error details" do expect(page).to have_content("3 errors") - end - it "displays error messages" do expect(page).to have_content("Name can't be blank") expect(page).to have_content("At least one hub must be selected") expect(page).to have_content("Amount: Invalid input. Please use only numbers.") - end - it "highlights invalid fields" do + # Highlighting invalid fields within '.calculator-settings .field .field_with_errors' do expect(page).to have_field "Amount" end