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:
parent
beda0fe9bd
commit
c768366240
1 changed files with 12 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue