mirror of
https://github.com/heartcombo/devise.git
synced 2022-11-09 12:18:31 -05:00
Change test email addresses to ues RFC 2606 reserved domain example.com
This commit is contained in:
parent
13376d22de
commit
2a5669967f
6 changed files with 13 additions and 13 deletions
|
@ -118,14 +118,14 @@ class RegistrationTest < ActionController::IntegrationTest
|
|||
sign_in_as_user
|
||||
get edit_user_registration_path
|
||||
|
||||
fill_in 'email', :with => 'user.new@email.com'
|
||||
fill_in 'email', :with => 'user.new@example.com'
|
||||
fill_in 'current password', :with => '123456'
|
||||
click_button 'Update'
|
||||
|
||||
assert_current_url '/'
|
||||
assert_contain 'You updated your account successfully.'
|
||||
|
||||
assert_equal "user.new@email.com", User.first.email
|
||||
assert_equal "user.new@example.com", User.first.email
|
||||
end
|
||||
|
||||
test 'a signed in user should still be able to use the website after changing his password' do
|
||||
|
@ -146,13 +146,13 @@ class RegistrationTest < ActionController::IntegrationTest
|
|||
sign_in_as_user
|
||||
get edit_user_registration_path
|
||||
|
||||
fill_in 'email', :with => 'user.new@email.com'
|
||||
fill_in 'email', :with => 'user.new@example.com'
|
||||
fill_in 'current password', :with => 'invalid'
|
||||
click_button 'Update'
|
||||
|
||||
assert_template 'registrations/edit'
|
||||
assert_contain 'user@test.com'
|
||||
assert_have_selector 'form input[value="user.new@email.com"]'
|
||||
assert_have_selector 'form input[value="user.new@example.com"]'
|
||||
|
||||
assert_equal "user@test.com", User.first.email
|
||||
end
|
||||
|
|
|
@ -111,12 +111,12 @@ class ConfirmableTest < ActiveSupport::TestCase
|
|||
end
|
||||
|
||||
test 'should return a new user if no email was found' do
|
||||
confirmation_user = User.send_confirmation_instructions(:email => "invalid@email.com")
|
||||
confirmation_user = User.send_confirmation_instructions(:email => "invalid@example.com")
|
||||
assert_not confirmation_user.persisted?
|
||||
end
|
||||
|
||||
test 'should add error to new user email if no email was found' do
|
||||
confirmation_user = User.send_confirmation_instructions(:email => "invalid@email.com")
|
||||
confirmation_user = User.send_confirmation_instructions(:email => "invalid@example.com")
|
||||
assert confirmation_user.errors[:email]
|
||||
assert_equal "not found", confirmation_user.errors[:email].join
|
||||
end
|
||||
|
|
|
@ -89,8 +89,8 @@ class DatabaseAuthenticatableTest < ActiveSupport::TestCase
|
|||
|
||||
test 'should ignore password and its confirmation if they are blank' do
|
||||
user = create_user
|
||||
assert user.update_with_password(:current_password => '123456', :email => "new@email.com")
|
||||
assert_equal "new@email.com", user.email
|
||||
assert user.update_with_password(:current_password => '123456', :email => "new@example.com")
|
||||
assert_equal "new@example.com", user.email
|
||||
end
|
||||
|
||||
test 'should not update password with invalid confirmation' do
|
||||
|
|
|
@ -163,12 +163,12 @@ class LockableTest < ActiveSupport::TestCase
|
|||
end
|
||||
|
||||
test 'should return a new user if no email was found' do
|
||||
unlock_user = User.send_unlock_instructions(:email => "invalid@email.com")
|
||||
unlock_user = User.send_unlock_instructions(:email => "invalid@example.com")
|
||||
assert_not unlock_user.persisted?
|
||||
end
|
||||
|
||||
test 'should add error to new user email if no email was found' do
|
||||
unlock_user = User.send_unlock_instructions(:email => "invalid@email.com")
|
||||
unlock_user = User.send_unlock_instructions(:email => "invalid@example.com")
|
||||
assert_equal 'not found', unlock_user.errors[:email].join
|
||||
end
|
||||
|
||||
|
|
|
@ -72,7 +72,7 @@ class RecoverableTest < ActiveSupport::TestCase
|
|||
end
|
||||
|
||||
test 'should return a new record with errors if user was not found by e-mail' do
|
||||
reset_password_user = User.send_reset_password_instructions(:email => "invalid@email.com")
|
||||
reset_password_user = User.send_reset_password_instructions(:email => "invalid@example.com")
|
||||
assert_not reset_password_user.persisted?
|
||||
assert_equal "not found", reset_password_user.errors[:email].join
|
||||
end
|
||||
|
|
|
@ -19,7 +19,7 @@ class ActiveSupport::TestCase
|
|||
def generate_unique_email
|
||||
@@email_count ||= 0
|
||||
@@email_count += 1
|
||||
"test#{@@email_count}@email.com"
|
||||
"test#{@@email_count}@example.com"
|
||||
end
|
||||
|
||||
def valid_attributes(attributes={})
|
||||
|
@ -57,4 +57,4 @@ class ActiveSupport::TestCase
|
|||
object.send :"#{key}=", value
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue