-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e2242a9
commit e406a98
Showing
2 changed files
with
24 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,6 +74,29 @@ class DatabaseAuthenticationTest < Devise::IntegrationTest | |
assert_not warden.authenticated?(:admin) | ||
end | ||
|
||
test 'sign in with invalid credentials should not invoke Devise::Encryptor.digest' do | ||
module ::Devise::Encryptor | ||
class << self | ||
alias original_digest digest | ||
|
||
def digest(klass, password) | ||
raise 'Devise::Encryptor.digest should not be called here.' | ||
end | ||
end | ||
end | ||
|
||
visit_with_option nil, new_user_session_path | ||
fill_in 'email', with: '[email protected]' | ||
fill_in 'password', with: 'abcdef' | ||
click_button 'Log In' | ||
|
||
module ::Devise::Encryptor | ||
class << self | ||
alias digest original_digest | ||
end | ||
end | ||
end | ||
|
||
test 'when in paranoid mode and without a valid e-mail' do | ||
swap Devise, paranoid: true do | ||
store_translations :en, devise: { failure: { not_found_in_database: 'Not found in database' } } do | ||
|