Skip to content

Commit

Permalink
Merge pull request #9152 from dahakawang/master
Browse files Browse the repository at this point in the history
test for issue 8931
  • Loading branch information
tenderlove committed Feb 4, 2013
2 parents 633d953 + 6e2cba1 commit 443be75
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions activemodel/test/cases/validations/length_validation_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.