diff options
author | Rafael França <rafael@franca.dev> | 2019-07-23 13:09:53 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-23 13:09:53 -0400 |
commit | d8bda0170210101df448313dcbf4ddd118e90327 (patch) | |
tree | 8b560cc8873d684e9412692583be7546cfe2e771 /activemodel/test/cases/errors_test.rb | |
parent | 0354b0d6c695bcbaa2750f47fa568dd3b69c59a3 (diff) | |
parent | ff0204bc7f5b33a04cfe4f053e3f24a65f0faff5 (diff) | |
download | rails-d8bda0170210101df448313dcbf4ddd118e90327.tar.gz rails-d8bda0170210101df448313dcbf4ddd118e90327.tar.bz2 rails-d8bda0170210101df448313dcbf4ddd118e90327.zip |
Merge pull request #36738 from Edouard-chin/ec-errors-to_hash-string
Modify behaviour of `AM::Errors#to_h`:
Diffstat (limited to 'activemodel/test/cases/errors_test.rb')
-rw-r--r-- | activemodel/test/cases/errors_test.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/activemodel/test/cases/errors_test.rb b/activemodel/test/cases/errors_test.rb index 79ccfe0c13..a6cd1da717 100644 --- a/activemodel/test/cases/errors_test.rb +++ b/activemodel/test/cases/errors_test.rb @@ -477,10 +477,11 @@ class ErrorsTest < ActiveModel::TestCase test "to_h is deprecated" do person = Person.new person.errors.add(:name, "cannot be blank") + person.errors.add(:name, "too long") - expected_deprecation = "ActiveModel::Errors#to_h is deprecated. Please call #to_hash instead." + expected_deprecation = "ActiveModel::Errors#to_h is deprecated" assert_deprecated(expected_deprecation) do - assert_equal({ name: ["cannot be blank"] }, person.errors.to_h) + assert_equal({ name: "too long" }, person.errors.to_h) end end |