diff options
author | sukesan1984 <takamikousuke@gmail.com> | 2016-06-01 14:40:45 +0000 |
---|---|---|
committer | sukesan1984 <takamikousuke@gmail.com> | 2016-06-02 04:17:15 +0000 |
commit | 3bd30d9824ca6f9542d371258c6c1b9cdc727585 (patch) | |
tree | 890dc98a9597e514ae5a10a77df8c7424fe86565 /activerecord/test/cases/validations | |
parent | 7b75ca100de247a40c78da89e28f4d71e0635b95 (diff) | |
download | rails-3bd30d9824ca6f9542d371258c6c1b9cdc727585.tar.gz rails-3bd30d9824ca6f9542d371258c6c1b9cdc727585.tar.bz2 rails-3bd30d9824ca6f9542d371258c6c1b9cdc727585.zip |
Add i18n_validation_test
add active record uniqueness validation test for { on: [:create, :update] } condition.
Diffstat (limited to 'activerecord/test/cases/validations')
-rw-r--r-- | activerecord/test/cases/validations/i18n_validation_test.rb | 6 |
1 files changed, 2 insertions, 4 deletions
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| |