diff options
author | Josh Susser <josh@hasmanythrough.com> | 2008-08-18 15:56:37 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-08-22 16:26:40 -0700 |
commit | e48e77e0222292176cd9f68658dd54524f582d9b (patch) | |
tree | b264ca7a6fb67fd7acad9d8f3eb1eb06fd8ddc41 /activerecord/test/cases/validations_test.rb | |
parent | 707ee0e2695e85186d59aa407f09691ebfcc3125 (diff) | |
download | rails-e48e77e0222292176cd9f68658dd54524f582d9b.tar.gz rails-e48e77e0222292176cd9f68658dd54524f582d9b.tar.bz2 rails-e48e77e0222292176cd9f68658dd54524f582d9b.zip |
coerce blank strings to nil values for boolean and integer fields
[#860 state:resolved]
Diffstat (limited to 'activerecord/test/cases/validations_test.rb')
-rw-r--r-- | activerecord/test/cases/validations_test.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/activerecord/test/cases/validations_test.rb b/activerecord/test/cases/validations_test.rb index 4b2d28c80b..a40bda2533 100644 --- a/activerecord/test/cases/validations_test.rb +++ b/activerecord/test/cases/validations_test.rb @@ -1420,8 +1420,8 @@ class ValidatesNumericalityTest < ActiveRecord::TestCase def test_validates_numericality_of_with_nil_allowed Topic.validates_numericality_of :approved, :allow_nil => true - invalid!(BLANK + JUNK) - valid!(NIL + FLOATS + INTEGERS + BIGDECIMAL + INFINITY) + invalid!(JUNK) + valid!(NIL + BLANK + FLOATS + INTEGERS + BIGDECIMAL + INFINITY) end def test_validates_numericality_of_with_integer_only @@ -1434,8 +1434,8 @@ class ValidatesNumericalityTest < ActiveRecord::TestCase def test_validates_numericality_of_with_integer_only_and_nil_allowed Topic.validates_numericality_of :approved, :only_integer => true, :allow_nil => true - invalid!(BLANK + JUNK + FLOATS + BIGDECIMAL + INFINITY) - valid!(NIL + INTEGERS) + invalid!(JUNK + FLOATS + BIGDECIMAL + INFINITY) + valid!(NIL + BLANK + INTEGERS) end def test_validates_numericality_with_greater_than |