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.
This commit is contained in:
David Cook
2023-04-04 16:25:10 +10:00
parent 364ccc2146
commit ce1bd12760

View File

@@ -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