Skip to content

Instantly share code, notes, and snippets.

@prathamesh-sonpatki
Created September 2, 2016 05:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prathamesh-sonpatki/4dd96cee548758bf63fd37004d6404a0 to your computer and use it in GitHub Desktop.
Save prathamesh-sonpatki/4dd96cee548758bf63fd37004d6404a0 to your computer and use it in GitHub Desktop.
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