Skip to content

Instantly share code, notes, and snippets.

@BernardoMG
Last active May 21, 2019 11:00
Show Gist options
  • Save BernardoMG/e313a0dbd98af99d41bdcd9631dd7676 to your computer and use it in GitHub Desktop.
Save BernardoMG/e313a0dbd98af99d41bdcd9631dd7676 to your computer and use it in GitHub Desktop.
require 'test_helper'
require 'sidekiq/testing' # test mode
class PrinterWorkerTest < ActiveSupport::TestCase
test 'should enqueue one job with success' do
PrinterWorker.perform_async("Buy me a pizza for dinner, please!")
assert_equal 1, PrinterWorker.jobs.size
PrinterWorker.drain
assert_equal 0, PrinterWorker.jobs.size
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment