diff options
author | Azzurrio <just.azzurri@gmail.com> | 2016-07-26 23:46:03 +0200 |
---|---|---|
committer | Azzurrio <just.azzurri@gmail.com> | 2016-07-28 04:12:15 +0200 |
commit | 80e825915c7ff638f4b668a7cca1be46903cb433 (patch) | |
tree | a6cc267cad01a1d639358f3156e61cc678bd11be /activejob/test/integration | |
parent | a64d9835f11ea7919fae825bceb91e08a1480766 (diff) | |
download | rails-80e825915c7ff638f4b668a7cca1be46903cb433.tar.gz rails-80e825915c7ff638f4b668a7cca1be46903cb433.tar.bz2 rails-80e825915c7ff638f4b668a7cca1be46903cb433.zip |
Fix accessing provider_job_id inside active jobs for sidekiq adapter
Diffstat (limited to 'activejob/test/integration')
-rw-r--r-- | activejob/test/integration/queuing_test.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/activejob/test/integration/queuing_test.rb b/activejob/test/integration/queuing_test.rb index 40f27500a5..ab3de3a8b9 100644 --- a/activejob/test/integration/queuing_test.rb +++ b/activejob/test/integration/queuing_test.rb @@ -1,6 +1,7 @@ require 'helper' require 'jobs/logging_job' require 'jobs/hello_job' +require 'jobs/provider_jid_job' require 'active_support/core_ext/numeric/time' class QueuingTest < ActiveSupport::TestCase @@ -34,6 +35,14 @@ class QueuingTest < ActiveSupport::TestCase end end + test 'should access provider_job_id inside Sidekiq job' do + skip unless adapter_is?(:sidekiq) + Sidekiq::Testing.inline! do + job = ::ProviderJidJob.perform_later + assert_equal "Provider Job ID: #{job.provider_job_id}", JobBuffer.last_value + end + end + test 'should not run job enqueued in the future' do begin TestJob.set(wait: 10.minutes).perform_later @id |