diff --git a/test/date_validator_test.rb b/test/date_validator_test.rb index fa25b14..d7c235b 100644 --- a/test/date_validator_test.rb +++ b/test/date_validator_test.rb @@ -84,6 +84,8 @@ module Validations it "allows custom validation message to be handled by I18n" do custom_message = 'Custom Date Message' + + I18n.backend.eager_load! if I18n.backend.respond_to?(:eager_load!) I18n.backend.store_translations('en', { errors: { messages: { not_a_date: custom_message }}}) TestRecord.validates :expiration_date, date: true diff --git a/test/test_helper.rb b/test/test_helper.rb index 21c7da1..cf49f39 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -12,6 +12,7 @@ require 'minitest/autorun' require 'active_model' +require 'active_support/core_ext/time/zones' require 'date_validator' I18n.load_path += Dir[File.expand_path(File.join(File.dirname(__FILE__), '../config/locales', '*.yml')).to_s]