mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Add test to better demonstrate ActiveModel::Errors#added?
behavior
Fixes #25410.
This commit is contained in:
parent
7980b31bc6
commit
87e8719da3
1 changed files with 6 additions and 0 deletions
|
@ -219,6 +219,12 @@ class ErrorsTest < ActiveModel::TestCase
|
|||
assert !person.errors.added?(:name, "cannot be blank")
|
||||
end
|
||||
|
||||
test "added? returns false when checking for an error, but not providing message arguments" do
|
||||
person = Person.new
|
||||
person.errors.add(:name, "cannot be blank")
|
||||
assert !person.errors.added?(:name)
|
||||
end
|
||||
|
||||
test "size calculates the number of error messages" do
|
||||
person = Person.new
|
||||
person.errors.add(:name, "cannot be blank")
|
||||
|
|
Loading…
Reference in a new issue