diff options
Diffstat (limited to 'activejob/test/integration')
-rw-r--r-- | activejob/test/integration/queuing_test.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/activejob/test/integration/queuing_test.rb b/activejob/test/integration/queuing_test.rb index d345092dee..e1634972d1 100644 --- a/activejob/test/integration/queuing_test.rb +++ b/activejob/test/integration/queuing_test.rb @@ -68,4 +68,21 @@ class QueuingTest < ActiveSupport::TestCase refute delayed_test_job.provider_job_id.nil?, 'Provider job id should by set for delayed jobs by provider' end + + test 'current locale is kept while running perform_later' do + skip if adapter_is?(:inline) + + begin + I18n.available_locales = [:en, :de] + I18n.locale = :de + + TestJob.perform_later @id + wait_for_jobs_to_finish_for(5.seconds) + assert job_executed + assert_equal 'de', job_output + ensure + I18n.available_locales = [:en] + I18n.locale = :en + end + end end |