mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
activemodel typo fix.
This commit is contained in:
parent
4e90d1577f
commit
38941df2aa
1 changed files with 3 additions and 3 deletions
|
@ -49,7 +49,7 @@ class ConditionalValidationTest < ActiveModel::TestCase
|
||||||
assert_empty t.errors[:title]
|
assert_empty t.errors[:title]
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_unless_validation_using_array_of_true_and_felse_methods
|
def test_unless_validation_using_array_of_true_and_false_methods
|
||||||
Topic.validates_length_of(:title, maximum: 5, too_long: "hoo %{count}", unless: [:condition_is_true, :condition_is_false])
|
Topic.validates_length_of(:title, maximum: 5, too_long: "hoo %{count}", unless: [:condition_is_true, :condition_is_false])
|
||||||
t = Topic.new("title" => "uhohuhoh", "content" => "whatever")
|
t = Topic.new("title" => "uhohuhoh", "content" => "whatever")
|
||||||
assert_predicate t, :valid?
|
assert_predicate t, :valid?
|
||||||
|
@ -111,14 +111,14 @@ class ConditionalValidationTest < ActiveModel::TestCase
|
||||||
assert_equal ["hoo 5"], t.errors["title"]
|
assert_equal ["hoo 5"], t.errors["title"]
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_validation_using_conbining_if_true_and_unless_true_conditions
|
def test_validation_using_combining_if_true_and_unless_true_conditions
|
||||||
Topic.validates_length_of(:title, maximum: 5, too_long: "hoo %{count}", if: :condition_is_true, unless: :condition_is_true)
|
Topic.validates_length_of(:title, maximum: 5, too_long: "hoo %{count}", if: :condition_is_true, unless: :condition_is_true)
|
||||||
t = Topic.new("title" => "uhohuhoh", "content" => "whatever")
|
t = Topic.new("title" => "uhohuhoh", "content" => "whatever")
|
||||||
assert_predicate t, :valid?
|
assert_predicate t, :valid?
|
||||||
assert_empty t.errors[:title]
|
assert_empty t.errors[:title]
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_validation_using_conbining_if_true_and_unless_false_conditions
|
def test_validation_using_combining_if_true_and_unless_false_conditions
|
||||||
Topic.validates_length_of(:title, maximum: 5, too_long: "hoo %{count}", if: :condition_is_true, unless: :condition_is_false)
|
Topic.validates_length_of(:title, maximum: 5, too_long: "hoo %{count}", if: :condition_is_true, unless: :condition_is_false)
|
||||||
t = Topic.new("title" => "uhohuhoh", "content" => "whatever")
|
t = Topic.new("title" => "uhohuhoh", "content" => "whatever")
|
||||||
assert_predicate t, :invalid?
|
assert_predicate t, :invalid?
|
||||||
|
|
Loading…
Reference in a new issue