aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases
diff options
context:
space:
mode:
authorJosh Susser <josh@hasmanythrough.com>2008-08-18 15:56:37 -0700
committerMichael Koziarski <michael@koziarski.com>2008-08-21 19:33:25 +0200
commitaee14630d4dc0856e597794cc731fac68c2d2e34 (patch)
treef3ad416bc299563352fcaa70c1bb15cad6191ca7 /activerecord/test/cases
parent8622787f8748434b4ceb2b925a35b17a38e1f2d6 (diff)
downloadrails-aee14630d4dc0856e597794cc731fac68c2d2e34.tar.gz
rails-aee14630d4dc0856e597794cc731fac68c2d2e34.tar.bz2
rails-aee14630d4dc0856e597794cc731fac68c2d2e34.zip
coerce blank strings to nil values for boolean and integer fields
Signed-off-by: Michael Koziarski <michael@koziarski.com>
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r--activerecord/test/cases/validations_test.rb8
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