diff options
Diffstat (limited to 'activemodel/test/cases/validations/i18n_validation_test.rb')
-rw-r--r-- | activemodel/test/cases/validations/i18n_validation_test.rb | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/activemodel/test/cases/validations/i18n_validation_test.rb b/activemodel/test/cases/validations/i18n_validation_test.rb index 35bb918f26..b7ee50832c 100644 --- a/activemodel/test/cases/validations/i18n_validation_test.rb +++ b/activemodel/test/cases/validations/i18n_validation_test.rb @@ -169,8 +169,8 @@ class I18nValidationTest < ActiveModel::TestCase # [ case, validation_options, generate_message_options] [ "given no options", {}, {}], [ "given custom message", { message: "custom" }, { message: "custom" }], - [ "given if condition", { if: lambda { true } }, {}], - [ "given unless condition", { unless: lambda { false } }, {}], + [ "given if condition", { if: lambda { true } }, {}], + [ "given unless condition", { unless: lambda { false } }, {}], [ "given option that is not reserved", { format: "jpg" }, { format: "jpg" }] ] @@ -181,6 +181,7 @@ class I18nValidationTest < ActiveModel::TestCase call = [:title_confirmation, :confirmation, generate_message_options.merge(attribute: "Title")] assert_called_with(@person.errors, :generate_message, call) do @person.valid? + @person.errors.messages end end end @@ -191,6 +192,7 @@ class I18nValidationTest < ActiveModel::TestCase call = [:title, :accepted, generate_message_options] assert_called_with(@person.errors, :generate_message, call) do @person.valid? + @person.errors.messages end end end @@ -201,6 +203,7 @@ class I18nValidationTest < ActiveModel::TestCase call = [:title, :blank, generate_message_options] assert_called_with(@person.errors, :generate_message, call) do @person.valid? + @person.errors.messages end end end @@ -211,6 +214,7 @@ class I18nValidationTest < ActiveModel::TestCase call = [:title, :too_short, generate_message_options.merge(count: 3)] assert_called_with(@person.errors, :generate_message, call) do @person.valid? + @person.errors.messages end end end @@ -222,6 +226,7 @@ class I18nValidationTest < ActiveModel::TestCase call = [:title, :too_long, generate_message_options.merge(count: 5)] assert_called_with(@person.errors, :generate_message, call) do @person.valid? + @person.errors.messages end end end @@ -232,6 +237,7 @@ class I18nValidationTest < ActiveModel::TestCase call = [:title, :wrong_length, generate_message_options.merge(count: 5)] assert_called_with(@person.errors, :generate_message, call) do @person.valid? + @person.errors.messages end end end @@ -243,6 +249,7 @@ class I18nValidationTest < ActiveModel::TestCase call = [:title, :invalid, generate_message_options.merge(value: "72x")] assert_called_with(@person.errors, :generate_message, call) do @person.valid? + @person.errors.messages end end end @@ -254,6 +261,7 @@ class I18nValidationTest < ActiveModel::TestCase call = [:title, :inclusion, generate_message_options.merge(value: "z")] assert_called_with(@person.errors, :generate_message, call) do @person.valid? + @person.errors.messages end end end @@ -265,6 +273,7 @@ class I18nValidationTest < ActiveModel::TestCase call = [:title, :inclusion, generate_message_options.merge(value: "z")] assert_called_with(@person.errors, :generate_message, call) do @person.valid? + @person.errors.messages end end end @@ -276,6 +285,7 @@ class I18nValidationTest < ActiveModel::TestCase call = [:title, :exclusion, generate_message_options.merge(value: "a")] assert_called_with(@person.errors, :generate_message, call) do @person.valid? + @person.errors.messages end end end @@ -287,6 +297,7 @@ class I18nValidationTest < ActiveModel::TestCase call = [:title, :exclusion, generate_message_options.merge(value: "a")] assert_called_with(@person.errors, :generate_message, call) do @person.valid? + @person.errors.messages end end end @@ -298,6 +309,7 @@ class I18nValidationTest < ActiveModel::TestCase call = [:title, :not_a_number, generate_message_options.merge(value: "a")] assert_called_with(@person.errors, :generate_message, call) do @person.valid? + @person.errors.messages end end end @@ -309,6 +321,7 @@ class I18nValidationTest < ActiveModel::TestCase call = [:title, :not_an_integer, generate_message_options.merge(value: "0.0")] assert_called_with(@person.errors, :generate_message, call) do @person.valid? + @person.errors.messages end end end @@ -320,6 +333,7 @@ class I18nValidationTest < ActiveModel::TestCase call = [:title, :odd, generate_message_options.merge(value: 0)] assert_called_with(@person.errors, :generate_message, call) do @person.valid? + @person.errors.messages end end end @@ -331,6 +345,7 @@ class I18nValidationTest < ActiveModel::TestCase call = [:title, :less_than, generate_message_options.merge(value: 1, count: 0)] assert_called_with(@person.errors, :generate_message, call) do @person.valid? + @person.errors.messages end end end |