Sha256: 188aa57b741d2ebbb06feb198fc7fcfb5ce8d0e5067d32c4b5fc24837701262b

Contents?: true

Size: 1019 Bytes

Versions: 15

Compression:

Stored size: 1019 Bytes

Contents

require 'helper'
require 'jobs/callback_job'

require 'active_support/core_ext/object/inclusion'

class CallbacksTest < ActiveSupport::TestCase
  test 'perform callbacks' do
    performed_callback_job = CallbackJob.new("A-JOB-ID")
    performed_callback_job.perform_now
    assert "CallbackJob ran before_perform".in? performed_callback_job.history
    assert "CallbackJob ran after_perform".in? performed_callback_job.history
    assert "CallbackJob ran around_perform_start".in? performed_callback_job.history
    assert "CallbackJob ran around_perform_stop".in? performed_callback_job.history
  end

  test 'enqueue callbacks' do
    enqueued_callback_job = CallbackJob.perform_later
    assert "CallbackJob ran before_enqueue".in? enqueued_callback_job.history
    assert "CallbackJob ran after_enqueue".in? enqueued_callback_job.history
    assert "CallbackJob ran around_enqueue_start".in? enqueued_callback_job.history
    assert "CallbackJob ran around_enqueue_stop".in? enqueued_callback_job.history
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
activejob-retry-0.6.3 test/cases/callbacks_test.rb
activejob-retry-0.6.2 test/cases/callbacks_test.rb
activejob-retry-0.6.1 test/cases/callbacks_test.rb
activejob-retry-0.6.0 test/cases/callbacks_test.rb
activejob-lock-0.0.2 rails/activejob/test/cases/callbacks_test.rb
activejob-retry-0.5.1 test/cases/callbacks_test.rb
activejob-retry-0.5.0 test/cases/callbacks_test.rb
activejob-retry-0.4.2 test/cases/callbacks_test.rb
activejob-retry-0.4.1 test/cases/callbacks_test.rb
activejob-lock-0.0.1 rails/activejob/test/cases/callbacks_test.rb
activejob-retry-0.4.0 test/cases/callbacks_test.rb
activejob-retry-0.3.1 test/cases/callbacks_test.rb
activejob-retry-0.3.0 test/cases/callbacks_test.rb
activejob-retry-0.2.0 test/cases/callbacks_test.rb
activejob-retry-0.1.1 test/cases/callbacks_test.rb