improve user email validation

This commit is contained in:
Alex Turchyn
2025-05-28 19:11:39 +03:00
committed by Pete Matsyburka
parent 8b9678a434
commit fa0733f480
4 changed files with 37 additions and 0 deletions
+10
View File
@@ -51,6 +51,16 @@ RSpec.describe 'App Setup' do
end
context 'when invalid information' do
it 'does not setup the app if the email is invalid' do
fill_setup_form(form_data.merge(email: 'bob@example-com'))
expect do
click_button 'Submit'
end.not_to(change(User, :count))
expect(page).to have_content('Email is invalid')
end
it 'does not setup the app if the password is too short' do
fill_setup_form(form_data.merge(password: 'pass'))