From 3bd30d9824ca6f9542d371258c6c1b9cdc727585 Mon Sep 17 00:00:00 2001 From: sukesan1984 Date: Wed, 1 Jun 2016 14:40:45 +0000 Subject: Add i18n_validation_test add active record uniqueness validation test for { on: [:create, :update] } condition. --- activerecord/test/cases/validations/i18n_validation_test.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'activerecord/test/cases/validations') diff --git a/activerecord/test/cases/validations/i18n_validation_test.rb b/activerecord/test/cases/validations/i18n_validation_test.rb index b8307d6665..5b5307489a 100644 --- a/activerecord/test/cases/validations/i18n_validation_test.rb +++ b/activerecord/test/cases/validations/i18n_validation_test.rb @@ -41,10 +41,8 @@ class I18nValidationTest < ActiveRecord::TestCase [ "given custom message", {:message => "custom"}, {:message => "custom"}], [ "given if condition", {:if => lambda { true }}, {}], [ "given unless condition", {:unless => lambda { false }}, {}], - [ "given option that is not reserved", {:format => "jpg"}, {:format => "jpg" }] - # TODO Add :on case, but below doesn't work, because then the validation isn't run for some reason - # even when using .save instead .valid? - # [ "given on condition", {on: :save}, {}] + [ "given option that is not reserved", {:format => "jpg"}, {:format => "jpg" }], + [ "given on condition", {on: [:create, :update] }, {}] ] COMMON_CASES.each do |name, validation_options, generate_message_options| -- cgit v1.2.3