aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2019-07-16 14:37:38 +0100
committerGitHub <noreply@github.com>2019-07-16 14:37:38 +0100
commitfdd5894aa985651fb99e0ef1c2d3f3f604b2f659 (patch)
tree1c60c9baeaf91a58e7f8eced580d8597a5a70ea3 /activerecord/test/cases
parent650c0701507c68625dc9a867cd3bf60ad6c421f8 (diff)
parentd204a09df21ce3578081108936a57707b5ece9b8 (diff)
downloadrails-fdd5894aa985651fb99e0ef1c2d3f3f604b2f659.tar.gz
rails-fdd5894aa985651fb99e0ef1c2d3f3f604b2f659.tar.bz2
rails-fdd5894aa985651fb99e0ef1c2d3f3f604b2f659.zip
Merge pull request #36639 from Edouard-chin/ec-am-errors-fullmessages
Move the `ActiveModel:Errors#full_message` method to the `Error` class:
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r--activerecord/test/cases/validations/i18n_validation_test.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/test/cases/validations/i18n_validation_test.rb b/activerecord/test/cases/validations/i18n_validation_test.rb
index 2645776ab7..4dd8a4a82b 100644
--- a/activerecord/test/cases/validations/i18n_validation_test.rb
+++ b/activerecord/test/cases/validations/i18n_validation_test.rb
@@ -51,7 +51,7 @@ class I18nValidationTest < ActiveRecord::TestCase
test "validates_uniqueness_of on generated message #{name}" do
Topic.validates_uniqueness_of :title, validation_options
@topic.title = unique_topic.title
- assert_called_with(@topic.errors, :generate_message, [:title, :taken, generate_message_options.merge(value: "unique!")]) do
+ assert_called_with(ActiveModel::Error, :generate_message, [:title, :taken, @topic, generate_message_options.merge(value: "unique!")]) do
@topic.valid?
@topic.errors.messages
end
@@ -61,7 +61,7 @@ class I18nValidationTest < ActiveRecord::TestCase
COMMON_CASES.each do |name, validation_options, generate_message_options|
test "validates_associated on generated message #{name}" do
Topic.validates_associated :replies, validation_options
- assert_called_with(replied_topic.errors, :generate_message, [:replies, :invalid, generate_message_options.merge(value: replied_topic.replies)]) do
+ assert_called_with(ActiveModel::Error, :generate_message, [:replies, :invalid, replied_topic, generate_message_options.merge(value: replied_topic.replies)]) do
replied_topic.save
replied_topic.errors.messages
end