Skip to content
Snippets Groups Projects
Commit 16b5777e authored by Taico Aerts's avatar Taico Aerts
Browse files

Expand registration test

Check that confirming email is required.
parent 4edcac65
Branches
Tags
2 merge requests!51Upgrade to latest qpixel,!50Update to latest codidact changes
...@@ -4,8 +4,9 @@ class LoginTest < ApplicationSystemTestCase ...@@ -4,8 +4,9 @@ class LoginTest < ApplicationSystemTestCase
test 'User can register a new account and sign-in to it after confirming their email' do test 'User can register a new account and sign-in to it after confirming their email' do
email = 'test@test.com' email = 'test@test.com'
username = 'Test User' username = 'Test User'
password = 'test123' password = 'login_test_1'
# Sign up for an account
visit root_url visit root_url
click_on 'Sign Up' click_on 'Sign Up'
fill_in 'Email', with: email fill_in 'Email', with: email
...@@ -19,6 +20,11 @@ class LoginTest < ApplicationSystemTestCase ...@@ -19,6 +20,11 @@ class LoginTest < ApplicationSystemTestCase
user = User.last user = User.last
# Try logging in directly, this should fail because not confirmed yet
log_in user, password
assert_selector '.notice', text: 'You have to confirm your email address before continuing.'
# Confirm email and sign in again, should succeed this time
confirm_email user confirm_email user
log_in user, password log_in user, password
assert_selector '.notice', text: 'Signed in successfully.' assert_selector '.notice', text: 'Signed in successfully.'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment