aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/test/cases/validations/length_validation_test.rb
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2010-01-08 08:34:44 +0100
committerJosé Valim <jose.valim@gmail.com>2010-01-08 21:36:04 +0100
commitfa14d6d51ed89acde66b49e8d3a6423396c3d553 (patch)
treebc7c7804f70c72d51580a44d5214610fe818a15a /activemodel/test/cases/validations/length_validation_test.rb
parent188d52165bc9184a143a468ee951981d159dbea6 (diff)
downloadrails-fa14d6d51ed89acde66b49e8d3a6423396c3d553.tar.gz
rails-fa14d6d51ed89acde66b49e8d3a6423396c3d553.tar.bz2
rails-fa14d6d51ed89acde66b49e8d3a6423396c3d553.zip
Compile length validator options still at the class level, so whenever the validator is called, it just needs to check for :maximum, :minimum and :is values.
Diffstat (limited to 'activemodel/test/cases/validations/length_validation_test.rb')
-rw-r--r--activemodel/test/cases/validations/length_validation_test.rb6
1 files changed, 2 insertions, 4 deletions
diff --git a/activemodel/test/cases/validations/length_validation_test.rb b/activemodel/test/cases/validations/length_validation_test.rb
index f3ef5e648a..99d0268b67 100644
--- a/activemodel/test/cases/validations/length_validation_test.rb
+++ b/activemodel/test/cases/validations/length_validation_test.rb
@@ -221,10 +221,8 @@ class LengthValidationTest < ActiveModel::TestCase
end
def test_validates_length_of_nasty_params
- assert_raise(ArgumentError) { Topic.validates_length_of(:title, :minimum=>6, :maximum=>9) }
- assert_raise(ArgumentError) { Topic.validates_length_of(:title, :within=>6, :maximum=>9) }
- assert_raise(ArgumentError) { Topic.validates_length_of(:title, :within=>6, :minimum=>9) }
- assert_raise(ArgumentError) { Topic.validates_length_of(:title, :within=>6, :is=>9) }
+ assert_raise(ArgumentError) { Topic.validates_length_of(:title, :is=>-6) }
+ assert_raise(ArgumentError) { Topic.validates_length_of(:title, :within=>6) }
assert_raise(ArgumentError) { Topic.validates_length_of(:title, :minimum=>"a") }
assert_raise(ArgumentError) { Topic.validates_length_of(:title, :maximum=>"a") }
assert_raise(ArgumentError) { Topic.validates_length_of(:title, :within=>"a") }