1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
require 'helper' require 'jobs/hello_job' class QueuingTest < ActiveSupport::TestCase setup do $BUFFER = [] end test 'run queued job' do HelloJob.enqueue assert_equal "David says hello", $BUFFER.pop end test 'run queued job with parameters' do HelloJob.enqueue "Jamie" assert_equal "Jamie says hello", $BUFFER.pop end end