aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/test
diff options
context:
space:
mode:
authorEmilio Tagua <miloops@gmail.com>2009-08-10 10:40:11 -0300
committerEmilio Tagua <miloops@gmail.com>2009-08-10 10:40:11 -0300
commiteb3ae44ccaff1dc63eb31bf86d8db07c88ddc413 (patch)
tree9997bd3739e30fad0102a22e8feee40c4c4c835c /activemodel/test
parent952014315926d370f2a0b681cb765948bf2e6883 (diff)
parent5786395760f1e1906c878df4023cac3741e66e87 (diff)
downloadrails-eb3ae44ccaff1dc63eb31bf86d8db07c88ddc413.tar.gz
rails-eb3ae44ccaff1dc63eb31bf86d8db07c88ddc413.tar.bz2
rails-eb3ae44ccaff1dc63eb31bf86d8db07c88ddc413.zip
Merge commit 'rails/master'
Conflicts: activerecord/lib/active_record/migration.rb
Diffstat (limited to 'activemodel/test')
-rw-r--r--activemodel/test/cases/validations/length_validation_test.rb9
1 files changed, 6 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..499f6a5e31 100644
--- a/activemodel/test/cases/validations/length_validation_test.rb
+++ b/activemodel/test/cases/validations/length_validation_test.rb
@@ -52,6 +52,12 @@ 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
+ assert t.valid?
+ end
+
def test_optionally_validates_length_of_using_minimum
Topic.validates_length_of :title, :minimum => 5, :allow_nil => true
@@ -75,9 +81,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