1
0
Fork 0
mirror of https://github.com/heartcombo/devise.git synced 2022-11-09 12:18:31 -05:00

Chase language changes in tests

This commit is contained in:
Oleg Pudeyev 2014-02-28 15:18:22 -05:00
parent dbddce6acd
commit 47845e44a2
6 changed files with 27 additions and 27 deletions

View file

@ -215,7 +215,7 @@ class FailureTest < ActiveSupport::TestCase
}
call_failure(env)
assert @response.third.body.include?('<h2>Sign in</h2>')
assert @response.third.body.include?('You have to confirm your account before continuing.')
assert @response.third.body.include?('You have to confirm your email address before continuing.')
end
test 'calls the original controller if inactive account' do

View file

@ -21,7 +21,7 @@ class ConfirmationTest < ActionDispatch::IntegrationTest
resend_confirmation
assert_current_url '/users/sign_in'
assert_contain 'You will receive an email with instructions about how to confirm your account in a few minutes'
assert_contain 'You will receive an email with instructions for how to confirm your email address in a few minutes'
assert_equal 1, ActionMailer::Base.deliveries.size
assert_equal ['please-change-me@config-initializers-devise.com'], ActionMailer::Base.deliveries.first.from
end
@ -56,7 +56,7 @@ class ConfirmationTest < ActionDispatch::IntegrationTest
assert_not user.confirmed?
visit_user_confirmation_with_token(user.raw_confirmation_token)
assert_contain 'Your account was successfully confirmed.'
assert_contain 'Your email address has been successfully confirmed.'
assert_current_url '/users/sign_in'
assert user.reload.confirmed?
end
@ -98,7 +98,7 @@ class ConfirmationTest < ActionDispatch::IntegrationTest
swap Devise, allow_unconfirmed_access_for: 0.days do
sign_in_as_user(confirm: false)
assert_contain 'You have to confirm your account before continuing'
assert_contain 'You have to confirm your email address before continuing'
assert_not warden.authenticated?(:user)
end
end
@ -128,7 +128,7 @@ class ConfirmationTest < ActionDispatch::IntegrationTest
user = sign_in_as_user(confirm: false)
visit_user_confirmation_with_token(user.raw_confirmation_token)
assert_contain 'Your account was successfully confirmed.'
assert_contain 'Your email address has been successfully confirmed.'
assert_current_url '/'
end
end
@ -187,7 +187,7 @@ class ConfirmationTest < ActionDispatch::IntegrationTest
fill_in 'email', with: user.email
click_button 'Resend confirmation instructions'
assert_contain "If your email address exists in our database, you will receive an email with instructions about how to confirm your account in a few minutes."
assert_contain "If your email address exists in our database, you will receive an email with instructions for how to confirm your email address in a few minutes."
assert_current_url "/users/sign_in"
end
end
@ -203,7 +203,7 @@ class ConfirmationTest < ActionDispatch::IntegrationTest
assert_not_contain "1 error prohibited this user from being saved:"
assert_not_contain "Email not found"
assert_contain "If your email address exists in our database, you will receive an email with instructions about how to confirm your account in a few minutes."
assert_contain "If your email address exists in our database, you will receive an email with instructions for how to confirm your email address in a few minutes."
assert_current_url "/users/sign_in"
end
end
@ -232,7 +232,7 @@ class ConfirmationOnChangeTest < ActionDispatch::IntegrationTest
end
assert_current_url '/admin_area/sign_in'
assert_contain 'You will receive an email with instructions about how to confirm your account in a few minutes'
assert_contain 'You will receive an email with instructions for how to confirm your email address in a few minutes'
end
test 'admin with valid confirmation token should be able to confirm email after email changed' do
@ -241,7 +241,7 @@ class ConfirmationOnChangeTest < ActionDispatch::IntegrationTest
assert_equal 'new_test@example.com', admin.unconfirmed_email
visit_admin_confirmation_with_token(admin.raw_confirmation_token)
assert_contain 'Your account was successfully confirmed.'
assert_contain 'Your email address has been successfully confirmed.'
assert_current_url '/admin_area/sign_in'
assert admin.reload.confirmed?
assert_not admin.reload.pending_reconfirmation?
@ -263,7 +263,7 @@ class ConfirmationOnChangeTest < ActionDispatch::IntegrationTest
assert_contain(/Confirmation token(.*)invalid/)
visit_admin_confirmation_with_token(admin.raw_confirmation_token)
assert_contain 'Your account was successfully confirmed.'
assert_contain 'Your email address has been successfully confirmed.'
assert_current_url '/admin_area/sign_in'
assert admin.reload.confirmed?
assert_not admin.reload.pending_reconfirmation?

View file

@ -42,7 +42,7 @@ class HttpAuthenticationTest < ActionDispatch::IntegrationTest
sign_in_as_new_user_with_http("unknown")
assert_equal 401, status
assert_equal "application/xml; charset=utf-8", headers["Content-Type"]
assert_match "<error>Invalid email or password.</error>", response.body
assert_match "<error>Invalid email address or password.</error>", response.body
end
test 'returns a custom response with www-authenticate and chosen realm' do

View file

@ -22,7 +22,7 @@ class LockTest < ActionDispatch::IntegrationTest
send_unlock_request
assert_template 'sessions/new'
assert_contain 'You will receive an email with instructions about how to unlock your account in a few minutes'
assert_contain 'You will receive an email with instructions for how to unlock your account in a few minutes'
mail = ActionMailer::Base.deliveries.last
assert_equal 1, ActionMailer::Base.deliveries.size
@ -182,7 +182,7 @@ class LockTest < ActionDispatch::IntegrationTest
click_button 'Resend unlock instructions'
assert_current_url "/users/sign_in"
assert_contain "If your account exists, you will receive an email with instructions about how to unlock it in a few minutes."
assert_contain "If your account exists, you will receive an email with instructions for how to unlock it in a few minutes."
end
end
@ -197,7 +197,7 @@ class LockTest < ActionDispatch::IntegrationTest
click_button 'Resend unlock instructions'
assert_current_url "/users/sign_in"
assert_contain "If your account exists, you will receive an email with instructions about how to unlock it in a few minutes."
assert_contain "If your account exists, you will receive an email with instructions for how to unlock it in a few minutes."
end
end
@ -213,7 +213,7 @@ class LockTest < ActionDispatch::IntegrationTest
assert_not_contain "Email not found"
assert_current_url "/users/sign_in"
assert_contain "If your account exists, you will receive an email with instructions about how to unlock it in a few minutes."
assert_contain "If your account exists, you will receive an email with instructions for how to unlock it in a few minutes."
end
end

View file

@ -171,7 +171,7 @@ class PasswordTest < ActionDispatch::IntegrationTest
reset_password
assert_current_url '/'
assert_contain 'Your password was changed successfully. You are now signed in.'
assert_contain 'Your password has been changed successfully. You are now signed in.'
assert user.reload.valid_password?('987654321')
end
@ -185,7 +185,7 @@ class PasswordTest < ActionDispatch::IntegrationTest
assert_not user.reload.valid_password?('987654321')
reset_password visit: false
assert_contain 'Your password was changed successfully.'
assert_contain 'Your password has been changed successfully.'
assert user.reload.valid_password?('987654321')
end
@ -204,7 +204,7 @@ class PasswordTest < ActionDispatch::IntegrationTest
request_forgot_password
reset_password
assert_contain 'Your password was changed successfully.'
assert_contain 'Your password has been changed successfully.'
assert_not_contain 'You are now signed in.'
assert_equal new_user_session_path, @request.path
assert !warden.authenticated?(:user)
@ -218,7 +218,7 @@ class PasswordTest < ActionDispatch::IntegrationTest
request_forgot_password
reset_password
assert_contain 'Your password was changed successfully.'
assert_contain 'Your password has been changed successfully.'
assert !user.reload.access_locked?
assert warden.authenticated?(:user)
end
@ -230,7 +230,7 @@ class PasswordTest < ActionDispatch::IntegrationTest
request_forgot_password
reset_password
assert_contain 'Your password was changed successfully.'
assert_contain 'Your password has been changed successfully.'
assert !user.reload.access_locked?
assert warden.authenticated?(:user)
end

View file

@ -50,7 +50,7 @@ class RegistrationTest < ActionDispatch::IntegrationTest
test 'a guest user should be able to sign up successfully and be blocked by confirmation' do
user_sign_up
assert_contain 'A message with a confirmation link has been sent to your email address. Please open the link to activate your account.'
assert_contain 'A message with a confirmation link has been sent to your email address. Please follow the link to activate your account.'
assert_not_contain 'You have to confirm your account before continuing'
assert_current_url "/"
@ -149,7 +149,7 @@ class RegistrationTest < ActionDispatch::IntegrationTest
click_button 'Update'
assert_current_url '/'
assert_contain 'You updated your account successfully.'
assert_contain 'Your account has been updated successfully.'
assert_equal "user.new@example.com", User.first.email
end
@ -163,7 +163,7 @@ class RegistrationTest < ActionDispatch::IntegrationTest
fill_in 'current password', with: '12345678'
click_button 'Update'
assert_contain 'You updated your account successfully.'
assert_contain 'Your account has been updated successfully.'
get users_path
assert warden.authenticated?(:user)
end
@ -193,7 +193,7 @@ class RegistrationTest < ActionDispatch::IntegrationTest
click_button 'Update'
assert_current_url '/'
assert_contain 'You updated your account successfully.'
assert_contain 'Your account has been updated successfully.'
assert User.first.valid_password?('pass1234')
end
@ -217,7 +217,7 @@ class RegistrationTest < ActionDispatch::IntegrationTest
get edit_user_registration_path
click_button "Cancel my account"
assert_contain "Bye! Your account was successfully cancelled. We hope to see you again soon."
assert_contain "Bye! Your account has been successfully cancelled. We hope to see you again soon."
assert User.all.empty?
end
@ -321,7 +321,7 @@ class ReconfirmableRegistrationTest < ActionDispatch::IntegrationTest
click_button 'Update'
assert_current_url '/admin_area/home'
assert_contain 'You updated your account successfully.'
assert_contain 'Your account has been updated successfully.'
assert Admin.first.valid_password?('pas123')
end
@ -341,7 +341,7 @@ class ReconfirmableRegistrationTest < ActionDispatch::IntegrationTest
click_button 'Update'
assert_current_url '/admin_area/home'
assert_contain 'You updated your account successfully.'
assert_contain 'Your account has been updated successfully.'
assert_equal "admin.new@example.com", Admin.first.unconfirmed_email
assert Admin.first.valid_password?('pas123')