diff --git a/test/system/login_test.rb b/test/system/login_test.rb index 4c29e7238ae010a0377aca88da6f68110dc5880d..71e16d24484894f28a7dc65244b061dca35183c6 100644 --- a/test/system/login_test.rb +++ b/test/system/login_test.rb @@ -4,8 +4,9 @@ class LoginTest < ApplicationSystemTestCase test 'User can register a new account and sign-in to it after confirming their email' do email = 'test@test.com' username = 'Test User' - password = 'test123' + password = 'login_test_1' + # Sign up for an account visit root_url click_on 'Sign Up' fill_in 'Email', with: email @@ -19,6 +20,11 @@ class LoginTest < ApplicationSystemTestCase 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 log_in user, password assert_selector '.notice', text: 'Signed in successfully.'