aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/validations_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test/validations_test.rb')
-rwxr-xr-xactiverecord/test/validations_test.rb25
1 files changed, 12 insertions, 13 deletions
diff --git a/activerecord/test/validations_test.rb b/activerecord/test/validations_test.rb
index d0d644a567..0d47eb15f9 100755
--- a/activerecord/test/validations_test.rb
+++ b/activerecord/test/validations_test.rb
@@ -165,19 +165,6 @@ class ValidationsTest < Test::Unit::TestCase
perform = false
end
- def test_errors_on_boundary_breaking
- developer = Developer.new("name" => "xs")
- assert !developer.save
- assert_equal "is too short (minimum is 3 characters)", developer.errors.on("name")
-
- developer.name = "All too very long for this boundary, it really is"
- assert !developer.save
- assert_equal "is too long (maximum is 20 characters)", developer.errors.on("name")
-
- developer.name = "Just right"
- assert developer.save
- end
-
def test_no_title_confirmation
Topic.validates_confirmation_of(:title)
@@ -626,6 +613,18 @@ class ValidationsTest < Test::Unit::TestCase
assert_equal 'tu est trops petit hombre 10', t.errors['title']
end
+
+ def test_add_on_boundary_breaking_is_deprecated
+ t = Topic.new('title' => 'noreplies', 'content' => 'whatever')
+ class << t
+ def validate
+ errors.add_on_boundary_breaking('title', 1..6)
+ end
+ end
+ assert_deprecated 'add_on_boundary_breaking' do
+ assert !t.valid?
+ end
+ end
def test_validates_size_of_association
assert_nothing_raised { Topic.validates_size_of :replies, :minimum => 1 }