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
+17
View File
@@ -92,6 +92,23 @@ RSpec.describe 'Team Settings' do
end
end
it 'does not allow to create a new user with an invalid email' do
click_link 'New User'
within '#modal' do
fill_in 'First name', with: 'Joseph'
fill_in 'Last name', with: 'Smith'
fill_in 'Email', with: 'joseph.smith@gmail'
fill_in 'Password', with: 'password'
expect do
click_button 'Submit'
end.not_to change(User, :count)
expect(page).to have_content('Email is invalid')
end
end
it 'updates a user' do
first(:link, 'Edit').click