Permalink
Browse files

Merge pull request #9152 from dahakawang/master

test for issue 8931
  • Loading branch information...
2 parents 633d953 + 6e2cba1 commit 443be7584c949e1193bbf74f6c2054d0b2c6f91a @tenderlove tenderlove committed Feb 4, 2013
Showing with 8 additions and 0 deletions.
  1. +8 −0 activemodel/test/cases/validations/length_validation_test.rb
@@ -414,4 +414,12 @@ def test_validates_length_of_using_is_0_should_not_allow_nil
t.title = ""
assert t.valid?
end
+
+ def test_validates_with_diff_in_option
+ Topic.validates_length_of( :title, :is => 5)
+ Topic.validates_length_of( :title, :is => 5, :if => Proc.new { false } )
+
+ assert Topic.new("title" => "david").valid?
+ assert Topic.new("title" => "david2").invalid?
+ end
end

0 comments on commit 443be75

Please sign in to comment.