diff options
author | InJung Chung <mu29gl@gmail.com> | 2016-08-18 16:44:28 +0900 |
---|---|---|
committer | InJung Chung <mu29gl@gmail.com> | 2016-08-19 17:10:27 +0900 |
commit | 9f6461a28cb5241b478884e84882cca8a0897cda (patch) | |
tree | 3c85deca9eb6fb2d130a2586eb327a00ea88a50c /activejob/test | |
parent | fd0c33d7cc8dd06083f543cf531ab1f4c52c6a6e (diff) | |
download | rails-9f6461a28cb5241b478884e84882cca8a0897cda.tar.gz rails-9f6461a28cb5241b478884e84882cca8a0897cda.tar.bz2 rails-9f6461a28cb5241b478884e84882cca8a0897cda.zip |
Added instance variable `@queue` to JobWrapper.
This will fix issues in [resque-scheduler](https://github.com/resque/resque-scheduler) `#job_to_hash` method,
so we can use `#enqueue_delayed_selection`, `#remove_delayed` method in resque-scheduler smoothly.
Diffstat (limited to 'activejob/test')
-rw-r--r-- | activejob/test/integration/queuing_test.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/activejob/test/integration/queuing_test.rb b/activejob/test/integration/queuing_test.rb index 41b6b9cd6b..2669c52a1c 100644 --- a/activejob/test/integration/queuing_test.rb +++ b/activejob/test/integration/queuing_test.rb @@ -43,6 +43,13 @@ class QueuingTest < ActiveSupport::TestCase end end + test "resque JobWrapper should have instance variable queue" do + skip unless adapter_is?(:resque) + job = ::HelloJob.set(wait: 5.seconds).perform_later + hash = Resque.decode(Resque.find_delayed_selection { true }[0]) + assert_equal hash["queue"], job.queue_name + end + test "should not run job enqueued in the future" do begin TestJob.set(wait: 10.minutes).perform_later @id |