Sha256: 017563bf0f0b72f53af5d31d536a9787d3e4d89d2839b8cb7847913a2600a38a

Contents?: true

Size: 875 Bytes

Versions: 7

Compression:

Stored size: 875 Bytes

Contents

module TransactionHelpers
  def uploaded_file
    if DependencyHelper.rails_present?
      ActionDispatch::Http::UploadedFile.new(:tempfile => '/tmp')
    else
      ::Rack::Multipart::UploadedFile.new(File.join(fixtures_dir, '/uploaded_file.txt'))
    end
  end

  def background_job_transaction(args={})
    Appsignal::Transaction.new(
      '1',
      Appsignal::Transaction::BACKGROUND_JOB,
      Appsignal::Transaction::GenericRequest.new({
        'SERVER_NAME' => 'localhost',
        'action_dispatch.routes' => 'not_available'
      }.merge(args))
    )
  end

  def http_request_transaction(args={})
    Appsignal::Transaction.new(
      '1',
      Appsignal::Transaction::HTTP_REQUEST,
      Appsignal::Transaction::GenericRequest.new({
        'SERVER_NAME' => 'localhost',
        'action_dispatch.routes' => 'not_available'
      }.merge(args))
    )
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
appsignal-2.0.6 spec/support/helpers/transaction_helpers.rb
appsignal-2.0.5 spec/support/helpers/transaction_helpers.rb
appsignal-2.0.5.beta.1 spec/support/helpers/transaction_helpers.rb
appsignal-2.1.0.alpha.3 spec/support/helpers/transaction_helpers.rb
appsignal-2.1.0.alpha.2 spec/support/helpers/transaction_helpers.rb
appsignal-2.1.0.alpha.1 spec/support/helpers/transaction_helpers.rb
appsignal-2.0.4 spec/support/helpers/transaction_helpers.rb