diff options
author | lulalala <mark@goodlife.tw> | 2018-12-26 22:35:45 +0800 |
---|---|---|
committer | lulalala <mark@goodlife.tw> | 2019-03-31 22:59:12 +0800 |
commit | 23dd7c0285fb81a675f8e18ee3be60397060655d (patch) | |
tree | e70a8cd8faf2e7ff84d7fff6663871b17e7749cd /activemodel/test/cases | |
parent | ba38b40e83302cb9da17c95086d93e5071426668 (diff) | |
download | rails-23dd7c0285fb81a675f8e18ee3be60397060655d.tar.gz rails-23dd7c0285fb81a675f8e18ee3be60397060655d.tar.bz2 rails-23dd7c0285fb81a675f8e18ee3be60397060655d.zip |
Assert deprecation
Diffstat (limited to 'activemodel/test/cases')
-rw-r--r-- | activemodel/test/cases/validations_test.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/activemodel/test/cases/validations_test.rb b/activemodel/test/cases/validations_test.rb index 82bb66b550..0b9e1b7005 100644 --- a/activemodel/test/cases/validations_test.rb +++ b/activemodel/test/cases/validations_test.rb @@ -53,7 +53,7 @@ class ValidationsTest < ActiveModel::TestCase r = Reply.new r.valid? - errors = r.errors.collect { |attr, messages| [attr.to_s, messages] } + errors = assert_deprecated { r.errors.collect { |attr, messages| [attr.to_s, messages] } } assert_includes errors, ["title", "is Empty"] assert_includes errors, ["content", "is Empty"] @@ -216,7 +216,7 @@ class ValidationsTest < ActiveModel::TestCase t = Topic.new assert_predicate t, :invalid? - xml = t.errors.to_xml + xml = assert_deprecated { t.errors.to_xml } assert_match %r{<errors>}, xml assert_match %r{<error>Title can't be blank</error>}, xml assert_match %r{<error>Content can't be blank</error>}, xml @@ -241,14 +241,14 @@ class ValidationsTest < ActiveModel::TestCase t = Topic.new title: "" assert_predicate t, :invalid? - assert_equal :title, key = t.errors.keys[0] + assert_equal :title, key = assert_deprecated { t.errors.keys[0] } assert_equal "can't be blank", t.errors[key][0] assert_equal "is too short (minimum is 2 characters)", t.errors[key][1] - assert_equal :author_name, key = t.errors.keys[1] + assert_equal :author_name, key = assert_deprecated { t.errors.keys[1] } assert_equal "can't be blank", t.errors[key][0] - assert_equal :author_email_address, key = t.errors.keys[2] + assert_equal :author_email_address, key = assert_deprecated { t.errors.keys[2] } assert_equal "will never be valid", t.errors[key][0] - assert_equal :content, key = t.errors.keys[3] + assert_equal :content, key = assert_deprecated { t.errors.keys[3] } assert_equal "is too short (minimum is 2 characters)", t.errors[key][0] end |