Sha256: 955ba8a17ac1e3f9e0aa52691051a8dcfd3bc13f621ceb2fe5543afafb6f46cc

Contents?: true

Size: 881 Bytes

Versions: 6

Compression:

Stored size: 881 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.create(
      '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.create(
      '1',
      Appsignal::Transaction::HTTP_REQUEST,
      Appsignal::Transaction::GenericRequest.new({
        'SERVER_NAME' => 'localhost',
        'action_dispatch.routes' => 'not_available'
      }.merge(args))
    )
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
appsignal-2.0.3 spec/support/helpers/transaction_helpers.rb
appsignal-2.0.2 spec/support/helpers/transaction_helpers.rb
appsignal-2.0.1 spec/support/helpers/transaction_helpers.rb
appsignal-2.0.0 spec/support/helpers/transaction_helpers.rb
appsignal-2.0.0.beta.1 spec/support/helpers/transaction_helpers.rb
appsignal-1.4.0.beta.1 spec/support/helpers/transaction_helpers.rb