mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
test for issue 8931
This commit is contained in:
parent
3e1f23125d
commit
6e2cba1c8b
1 changed files with 8 additions and 0 deletions
|
@ -414,4 +414,12 @@ class LengthValidationTest < ActiveModel::TestCase
|
|||
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
|
||||
|
|
Loading…
Reference in a new issue