Skip to content

Commit

Permalink
Merge pull request #86 from PlayerData/fix-test-flakes
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcasals authored Feb 1, 2021
2 parents 6058aee + b94fbc9 commit 849f45a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/date_validator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 849f45a

Please sign in to comment.