Sha256: f6c4b558937ba9f6e84e08c4f6f1d438b55eced2a1865961e036149c392563c6

Contents?: true

Size: 547 Bytes

Versions: 85

Compression:

Stored size: 547 Bytes

Contents

# frozen_string_literal: true

module Spree
  module TestingSupport
    module JobHelpers
      def perform_enqueued_jobs
        adapter = ActiveJob::Base.queue_adapter

        old = adapter.perform_enqueued_jobs
        old_at = adapter.perform_enqueued_at_jobs

        begin
          adapter.perform_enqueued_jobs = true
          adapter.perform_enqueued_at_jobs = true

          yield
        ensure
          adapter.perform_enqueued_jobs = old
          adapter.perform_enqueued_at_jobs = old_at
        end
      end
    end
  end
end

Version data entries

85 entries across 85 versions & 1 rubygems

Version Path
solidus_core-4.4.2 lib/spree/testing_support/job_helpers.rb
solidus_core-4.4.1 lib/spree/testing_support/job_helpers.rb
solidus_core-4.4.0 lib/spree/testing_support/job_helpers.rb
solidus_core-4.3.4 lib/spree/testing_support/job_helpers.rb
solidus_core-4.2.4 lib/spree/testing_support/job_helpers.rb
solidus_core-4.1.5 lib/spree/testing_support/job_helpers.rb
solidus_core-4.3.3 lib/spree/testing_support/job_helpers.rb
solidus_core-4.3.2 lib/spree/testing_support/job_helpers.rb
solidus_core-4.1.4 lib/spree/testing_support/job_helpers.rb
solidus_core-4.3.1 lib/spree/testing_support/job_helpers.rb
solidus_core-4.3.0 lib/spree/testing_support/job_helpers.rb
solidus_core-4.2.3 lib/spree/testing_support/job_helpers.rb
solidus_core-4.1.3 lib/spree/testing_support/job_helpers.rb
solidus_core-4.0.4 lib/spree/testing_support/job_helpers.rb
solidus_core-3.4.6 lib/spree/testing_support/job_helpers.rb
solidus_core-4.0.3 lib/spree/testing_support/job_helpers.rb
solidus_core-4.1.2 lib/spree/testing_support/job_helpers.rb
solidus_core-4.2.2 lib/spree/testing_support/job_helpers.rb
solidus_core-3.4.5 lib/spree/testing_support/job_helpers.rb
solidus_core-4.2.1 lib/spree/testing_support/job_helpers.rb