diff options
author | José Valim <jose.valim@gmail.com> | 2010-01-08 08:34:44 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-01-08 21:36:04 +0100 |
commit | fa14d6d51ed89acde66b49e8d3a6423396c3d553 (patch) | |
tree | bc7c7804f70c72d51580a44d5214610fe818a15a /activemodel/test/cases/validations | |
parent | 188d52165bc9184a143a468ee951981d159dbea6 (diff) | |
download | rails-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')
-rw-r--r-- | activemodel/test/cases/validations/length_validation_test.rb | 6 |
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") } |