aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/test/cases/validations/length_validation_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activemodel/test/cases/validations/length_validation_test.rb')
-rw-r--r--activemodel/test/cases/validations/length_validation_test.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/activemodel/test/cases/validations/length_validation_test.rb b/activemodel/test/cases/validations/length_validation_test.rb
index 4a2f72feab..bc24900ecf 100644
--- a/activemodel/test/cases/validations/length_validation_test.rb
+++ b/activemodel/test/cases/validations/length_validation_test.rb
@@ -52,6 +52,13 @@ class LengthValidationTest < ActiveModel::TestCase
assert_equal ["is too short (minimum is 5 characters)"], t.errors["title"]
end
+ def test_validates_length_of_using_maximum_should_allow_nil
+ Topic.validates_length_of :title, :maximum => 10
+ t = Topic.create
+ puts t.errors
+ assert t.valid?
+ end
+
def test_optionally_validates_length_of_using_minimum
Topic.validates_length_of :title, :minimum => 5, :allow_nil => true
@@ -75,9 +82,6 @@ class LengthValidationTest < ActiveModel::TestCase
t.title = ""
assert t.valid?
-
- t.title = nil
- assert !t.valid?
end
def test_optionally_validates_length_of_using_maximum