From 157c37f55854a17fcb50e77b7636fab01773df3c Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Sat, 12 Mar 2011 21:10:19 -0200 Subject: Refactor length validation --- activemodel/test/cases/validations/length_validation_test.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'activemodel/test') diff --git a/activemodel/test/cases/validations/length_validation_test.rb b/activemodel/test/cases/validations/length_validation_test.rb index 5e4f4f5cae..f02514639b 100644 --- a/activemodel/test/cases/validations/length_validation_test.rb +++ b/activemodel/test/cases/validations/length_validation_test.rb @@ -341,14 +341,14 @@ class LengthValidationTest < ActiveModel::TestCase assert t.errors[:content].any? assert_equal ["Your essay must be at least 5 words."], t.errors[:content] end - + def test_validates_length_of_for_fixnum Topic.validates_length_of(:approved, :is => 4) - + t = Topic.new("title" => "uhohuhoh", "content" => "whatever", :approved => 1) assert t.invalid? assert t.errors[:approved].any? - + t = Topic.new("title" => "uhohuhoh", "content" => "whatever", :approved => 1234) assert t.valid? end -- cgit v1.2.3