From 77a4ead0738b23754b925a1425410946eae4254d Mon Sep 17 00:00:00 2001 From: baarkerlounger Date: Thu, 2 Dec 2021 17:27:57 +0000 Subject: [PATCH] Test email validation --- spec/features/user_spec.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/spec/features/user_spec.rb b/spec/features/user_spec.rb index d8d2d1e9b..9f2eaf9b2 100644 --- a/spec/features/user_spec.rb +++ b/spec/features/user_spec.rb @@ -173,6 +173,15 @@ RSpec.describe "User Features" do click_button("Sign in") end + it "validates an email has been provided" do + visit("users/new") + fill_in("user[name]", with: "New User") + click_button("Continue") + expect(page).to have_selector("#error-summary-title") + expect(page).to have_selector("#user-email-field-error") + expect(page).to have_content(/Enter an email address/) + end + it "validates email" do visit("users/new") fill_in("user[name]", with: "New User")