diff --git a/spec/system/users/forgot_password_spec.rb b/spec/system/users/forgot_password_spec.rb index 34ee51ede..797df47a3 100644 --- a/spec/system/users/forgot_password_spec.rb +++ b/spec/system/users/forgot_password_spec.rb @@ -11,7 +11,7 @@ # Then I see an invalid credentials message scenario 'user cannot forgot password if not registered', js: true do forgot_password('test@example.com') - expect(page).to have_content "Email *\n" + I18n.t('errors.messages.not_found') + expect(page).to have_content "Email *\nnot found" end # Scenario: User can forgot password with valid credentials @@ -22,7 +22,7 @@ scenario 'user can forgot password with valid credentials', js: true do user = FactoryBot.create(:user) forgot_password(user.email) - expect(page).to have_content I18n.t 'devise.passwords.send_instructions' + expect(page).to have_content 'You will receive an email with instructions on how to reset your password in a few minutes.' end # Scenario: User cannot forgot password with wrong email @@ -32,7 +32,7 @@ # Then I see an invalid email message scenario 'user cannot forgot password with wrong email', js: true do forgot_password('invalid@email.com') - expect(page).to have_content "Email *\n" + I18n.t('errors.messages.not_found') + expect(page).to have_content "Email *\nnot found" end end diff --git a/spec/system/users/sign_in_spec.rb b/spec/system/users/sign_in_spec.rb index 37b91eb81..7f2a1e009 100644 --- a/spec/system/users/sign_in_spec.rb +++ b/spec/system/users/sign_in_spec.rb @@ -11,7 +11,7 @@ # Then I see an invalid credentials message scenario 'user cannot sign in if not registered' do signin('test@example.com', 'please123') - expect(page).to have_content I18n.t 'devise.failure.not_found_in_database', authentication_keys: 'Email' + expect(page).to have_content 'Invalid Email or password.' end # Scenario: User can sign in with valid credentials @@ -22,7 +22,7 @@ scenario 'user can sign in with valid credentials' do user = FactoryBot.create(:user) signin(user.email, user.password) - expect(page).to have_content I18n.t 'devise.sessions.signed_in' + expect(page).to have_content 'Signed in successfully.' end # Scenario: User cannot sign in with wrong email @@ -33,7 +33,7 @@ scenario 'user cannot sign in with wrong email' do user = FactoryBot.create(:user) signin('invalid@email.com', user.password) - expect(page).to have_content I18n.t 'devise.failure.not_found_in_database', authentication_keys: 'Email' + expect(page).to have_content 'Invalid Email or password.' end # Scenario: User cannot sign in with wrong password @@ -44,7 +44,7 @@ scenario 'user cannot sign in with wrong password' do user = FactoryBot.create(:user) signin(user.email, 'invalidpass') - expect(page).to have_content I18n.t 'devise.failure.invalid', authentication_keys: 'Email', normalize_ws: true + expect(page).to have_content 'Invalid Email or password.' end # Scenario: Organizer User gets redirected to the events_path diff --git a/spec/system/users/sign_out_spec.rb b/spec/system/users/sign_out_spec.rb index 832bc930f..8d6defcbc 100644 --- a/spec/system/users/sign_out_spec.rb +++ b/spec/system/users/sign_out_spec.rb @@ -13,13 +13,13 @@ user = FactoryBot.create(:user) signin(user.email, user.password) - expect(page).to have_content I18n.t 'devise.sessions.signed_in' + expect(page).to have_content 'Signed in successfully.' find('.gravatar-container').click find('.dropdown-menu').find('a', text: 'Sign Out').click - expect(page).to have_no_content I18n.t('devise.sessions.signed_in') - expect(page).to have_content I18n.t 'devise.sessions.signed_out' + expect(page).to have_no_content 'Signed in successfully.' + expect(page).to have_content 'Signed out successfully.' end end diff --git a/spec/system/users/sign_up_spec.rb b/spec/system/users/sign_up_spec.rb index 477b7d7fa..6d26db736 100644 --- a/spec/system/users/sign_up_spec.rb +++ b/spec/system/users/sign_up_spec.rb @@ -49,6 +49,6 @@ scenario 'user can sign up with valid credentials' do user = build(:user) sign_up_with(user.email, user.password, user.password) - expect(page).to have_content I18n.t('devise.registrations.signed_up_but_unconfirmed') + expect(page).to have_content 'A message with a confirmation link has been sent to your email address. Please follow the link to activate your account.' end end