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

add test for after_database_authentication

This commit is contained in:
BM5k 2014-11-08 15:52:39 -07:00
parent 910868785c
commit 6f88df3453

View file

@ -81,4 +81,15 @@ class DatabaseAuthenticationTest < ActionDispatch::IntegrationTest
assert_contain 'Invalid credentials'
end
end
test 'valid sign in calls after_database_authentication callback' do
user = create_user(email: ' foo@bar.com ')
User.expects(:find_for_database_authentication).returns user
user.expects :after_database_authentication
sign_in_as_user do
fill_in 'email', with: 'foo@bar.com'
end
end
end