test/overrides/data_mapper_test.rb in dm-devise-2.1.0 vs test/overrides/data_mapper_test.rb in dm-devise-2.2.0

- old
+ new

@@ -61,9 +61,22 @@ assert_equal email, user.email user.save assert_equal email.downcase, user.email end + undef test_should_downcase_case_insensitive_keys_that_refer_to_virtual_attributes_when_saving + + test 'should downcase case insensitive keys that refer to virtual attributes when saving' do + email = 'Foo@Bar1.com' + confirmation = 'Foo@Bar1.com' + attributes = valid_attributes(:email => email, :email_confirmation => confirmation) + user = UserWithVirtualAttributes.new(attributes) + + assert_equal confirmation, user.email_confirmation + user.save + assert_equal confirmation.downcase, user.email_confirmation + end + undef test_should_remove_whitespace_from_strip_whitespace_keys_when_saving test 'should remove whitespace from strip whitespace keys when saving' do # strip_whitespace_keys is set to :email by default. email = ' foo@bar.com '