mirror of
https://github.com/heartcombo/devise.git
synced 2022-11-09 12:18:31 -05:00
Add failing test for #2129
This commit is contained in:
parent
77ec1b08cd
commit
0c6f2adf14
1 changed files with 15 additions and 0 deletions
|
@ -13,6 +13,21 @@ class DatabaseAuthenticatableTest < ActiveSupport::TestCase
|
||||||
assert_equal email.downcase, user.email
|
assert_equal email.downcase, user.email
|
||||||
end
|
end
|
||||||
|
|
||||||
|
test 'should downcase case insensitive keys that refer to virtual attributes when saving' do
|
||||||
|
email = 'Foo@Bar1.com'
|
||||||
|
confirmation = 'Foo@Bar1.com'
|
||||||
|
pw = '12345678'
|
||||||
|
user = UserWithVirtualAttributes.new(
|
||||||
|
:email => email,
|
||||||
|
:email_confirmation => confirmation,
|
||||||
|
:password => pw,
|
||||||
|
:password_confirmation => pw)
|
||||||
|
|
||||||
|
assert_nothing_raised "ActiveRecord::RecordInvalid" do
|
||||||
|
user.save!
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
test 'should remove whitespace from strip whitespace keys when saving' do
|
test 'should remove whitespace from strip whitespace keys when saving' do
|
||||||
# strip_whitespace_keys is set to :email by default.
|
# strip_whitespace_keys is set to :email by default.
|
||||||
email = ' foo@bar.com '
|
email = ' foo@bar.com '
|
||||||
|
|
Loading…
Reference in a new issue