Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
begin
require "bundler/inline"
rescue LoadError => e
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler"
raise e
end
gemfile(true) do
source "https://rubygems.org"
# Activate the gem you are reporting the issue against.
gem "activejob", "5.0.0"
gem "sidekiq"
end
require "minitest/autorun"
require "active_job"
require "sidekiq"
# Ensure backward compatibility with Minitest 4
Minitest::Test = MiniTest::Unit::TestCase unless defined?(Minitest::Test)
class BidGoodsItemExpiredJob < ActiveJob::Base
self.queue_adapter = :sidekiq
def perform
p self.class.queue_adapter
puts "performed"
end
end
class BugTest < ActiveJob::TestCase
def test_stuff
assert_enqueued_with(job: BidGoodsItemExpiredJob) do
BidGoodsItemExpiredJob.set(wait_until: 1.hour).perform_later
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.