diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2016-06-21 16:47:44 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-06-21 16:47:44 -0300 |
commit | 1a4474c2c78c9d658b6399472c5eb8f1aae44033 (patch) | |
tree | 190e97cb399ba791f11d0050004984ce75a7b132 | |
parent | 7ad8093b0eaff02bda6bb2999e8a81a481667aab (diff) | |
parent | 87e8719da3e1623ce8d2c9f4e9ebfcbc7ab3a468 (diff) | |
download | rails-1a4474c2c78c9d658b6399472c5eb8f1aae44033.tar.gz rails-1a4474c2c78c9d658b6399472c5eb8f1aae44033.tar.bz2 rails-1a4474c2c78c9d658b6399472c5eb8f1aae44033.zip |
Merge pull request #25415 from maclover7/jm-fix-25410
Add test to better demonstrate `ActiveModel::Errors#added?` behavior
-rw-r--r-- | activemodel/test/cases/errors_test.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/activemodel/test/cases/errors_test.rb b/activemodel/test/cases/errors_test.rb index c90ee7021c..13fa5c76bc 100644 --- a/activemodel/test/cases/errors_test.rb +++ b/activemodel/test/cases/errors_test.rb @@ -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") |