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

Conditional string conversion of auth params (Closes #1079)

This commit is contained in:
Xavier Defrang 2011-05-26 15:45:03 +02:00
parent 69126a31db
commit ab3bb9cf4d
2 changed files with 12 additions and 1 deletions

View file

@ -28,6 +28,12 @@ class DatabaseAuthenticatableTest < ActiveSupport::TestCase
assert_equal({ 'login' => 'foo@bar.com' }, conditions)
end
test "filter_auth_params should not convert booleans and integer to strings" do
conditions = { 'login' => 'foo@bar.com', "bool1" => true, "bool2" => false, "fixnum" => 123, "will_be_converted" => (1..10) }
conditions = User.__send__(:filter_auth_params, conditions)
assert_equal( { 'login' => 'foo@bar.com', "bool1" => true, "bool2" => false, "fixnum" => 123, "will_be_converted" => "1..10" }, conditions)
end
test 'should respond to password and password confirmation' do
user = new_user