mirror of
https://github.com/heartcombo/devise.git
synced 2026-01-20 20:28:03 -05:00
Fix failing tests.
This commit is contained in:
@@ -34,11 +34,11 @@ class DatabaseAuthenticationTest < ActionController::IntegrationTest
|
||||
end
|
||||
|
||||
test 'sign in with email including extra spaces should fail when email is NOT the list of strip whitespace keys' do
|
||||
swap Devise, :case_insensitive_keys => [] do
|
||||
create_user(:email => ' foo@bar.com ')
|
||||
swap Devise, :strip_whitespace_keys => [] do
|
||||
create_user(:email => 'foo@bar.com')
|
||||
|
||||
sign_in_as_user do
|
||||
fill_in 'email', :with => 'foo@bar.com'
|
||||
fill_in 'email', :with => ' foo@bar.com '
|
||||
end
|
||||
|
||||
assert_not warden.authenticated?(:user)
|
||||
|
||||
@@ -54,10 +54,10 @@ class PasswordTest < ActionController::IntegrationTest
|
||||
end
|
||||
|
||||
test 'reset password with email with extra whitespace should succeed when email is in the list of strip whitespace keys' do
|
||||
create_user(:email => ' foo@bar.com ')
|
||||
create_user(:email => 'foo@bar.com')
|
||||
|
||||
request_forgot_password do
|
||||
fill_in 'email', :with => 'foo@bar.com'
|
||||
fill_in 'email', :with => ' foo@bar.com '
|
||||
end
|
||||
|
||||
assert_current_url '/users/sign_in'
|
||||
@@ -65,16 +65,16 @@ class PasswordTest < ActionController::IntegrationTest
|
||||
end
|
||||
|
||||
test 'reset password with email with extra whitespace should fail when email is NOT the list of strip whitespace keys' do
|
||||
swap Devise, :case_insensitive_keys => [] do
|
||||
create_user(:email => ' foo@bar.com ')
|
||||
swap Devise, :strip_whitespace_keys => [] do
|
||||
create_user(:email => 'foo@bar.com')
|
||||
|
||||
request_forgot_password do
|
||||
fill_in 'email', :with => 'foo@bar.com'
|
||||
fill_in 'email', :with => ' foo@bar.com '
|
||||
end
|
||||
|
||||
assert_response :success
|
||||
assert_current_url '/users/password'
|
||||
assert_have_selector "input[type=email][value='foo@bar.com']"
|
||||
assert_have_selector "input[type=email][value=' foo@bar.com ']"
|
||||
assert_contain 'not found'
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user