Sha256: 62f3a4d6471fcab7622a46c3f8f583d2e6bfa0393cfdfe8e9cdff313de1cf790

Contents?: true

Size: 879 Bytes

Versions: 20

Compression:

Stored size: 879 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

20 entries across 20 versions & 1 rubygems

Version Path
appsignal-2.4.0 spec/support/helpers/transaction_helpers.rb
appsignal-2.3.6 spec/support/helpers/transaction_helpers.rb
appsignal-2.3.6.beta.1 spec/support/helpers/transaction_helpers.rb
appsignal-2.3.4 spec/support/helpers/transaction_helpers.rb
appsignal-2.3.3 spec/support/helpers/transaction_helpers.rb
appsignal-2.3.3.beta.1 spec/support/helpers/transaction_helpers.rb
appsignal-2.3.2 spec/support/helpers/transaction_helpers.rb
appsignal-2.3.1 spec/support/helpers/transaction_helpers.rb
appsignal-2.3.0 spec/support/helpers/transaction_helpers.rb
appsignal-2.3.0.beta.3 spec/support/helpers/transaction_helpers.rb
appsignal-2.3.0.beta.2 spec/support/helpers/transaction_helpers.rb
appsignal-2.3.0.beta.1 spec/support/helpers/transaction_helpers.rb
appsignal-2.2.1 spec/support/helpers/transaction_helpers.rb
appsignal-2.2.0 spec/support/helpers/transaction_helpers.rb
appsignal-2.2.0.beta.1 spec/support/helpers/transaction_helpers.rb
appsignal-2.1.2 spec/support/helpers/transaction_helpers.rb
appsignal-2.1.1 spec/support/helpers/transaction_helpers.rb
appsignal-2.1.1.beta.1 spec/support/helpers/transaction_helpers.rb
appsignal-2.1.0 spec/support/helpers/transaction_helpers.rb
appsignal-2.1.0.beta.1 spec/support/helpers/transaction_helpers.rb