Skip to content

Commit

Permalink
Add a spec showing a validation error for admin/products
Browse files Browse the repository at this point in the history
  • Loading branch information
elia committed Sep 19, 2023
1 parent 6db6712 commit fcf7962
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion admin/spec/features/product_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)")
Expand Down

0 comments on commit fcf7962

Please sign in to comment.