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

Add failing tests for Issue #2204

For a point release upgrade, Devise should not throw an exception when trying
to downcase or strip globally configured keys. This would be a breaking
change in functionality and this test demonstrates the issue.
This commit is contained in:
Drew Ulmer 2013-01-09 11:41:20 -06:00
parent beda0fe9bd
commit c768366240

View file

@ -34,6 +34,18 @@ class DatabaseAuthenticatableTest < ActiveSupport::TestCase
assert_equal email.strip, user.email
end
test "doesn't throw exception when globally configured strip_whitespace_keys are not present on a model" do
swap Devise, :strip_whitespace_keys => [:fake_key] do
assert_nothing_raised { create_user }
end
end
test "doesn't throw exception when globally configured case_insensitive_keys are not present on a model" do
swap Devise, :case_insensitive_keys => [:fake_key] do
assert_nothing_raised { create_user }
end
end
test "param filter 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 = Devise::ParamFilter.new([], []).filter(conditions)