1
0
Fork 0
mirror of https://github.com/heartcombo/devise.git synced 2022-11-09 12:18:31 -05:00
heartcombo--devise/test/models/http_authenticatable_test.rb
2010-03-26 11:27:19 +01:00

19 lines
589 B
Ruby

require 'test_helper'
class HttpAuthenticatableTest < ActiveSupport::TestCase
test 'should authenticate a valid user with email and password and return it' do
user = create_user
user.confirm!
authenticated_user = User.authenticate_with_http(user.email, user.password)
assert_equal authenticated_user, user
end
test 'should return nil when authenticating an invalid user by email' do
user = create_user
user.confirm!
authenticated_user = User.authenticate_with_http('another.email@email.com', user.password)
assert_nil authenticated_user
end
end