From fcf7962716250a4fe3b058e46bca0f8d3e9f89bc Mon Sep 17 00:00:00 2001 From: Elia Schito Date: Tue, 19 Sep 2023 12:00:11 +0200 Subject: [PATCH] Add a spec showing a validation error for admin/products --- admin/spec/features/product_spec.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/admin/spec/features/product_spec.rb b/admin/spec/features/product_spec.rb index 9948b41fb2b..38ba75e506f 100644 --- a/admin/spec/features/product_spec.rb +++ b/admin/spec/features/product_spec.rb @@ -36,7 +36,11 @@ visit "/admin/products/just-a-prod" - fill_in "Name", with: "Just a product (updated)" + fill_in "Name", with: "" + within('header') { click_button "Save" } + expect(page).to have_content("Name can't be blank") + + fill_in "Name can't be blank", with: "Just a product (updated)" within('header') { click_button "Save" } expect(page).to have_content("Just a product (updated)")