Sha256: 2949569c3c9eae73f4eac7d2a7d5c09ff94ead45e44a46bf926baf32a96ae2e6

Contents?: true

Size: 813 Bytes

Versions: 157

Compression:

Stored size: 813 Bytes

Contents

module EnvHelpers
  def http_request_env_with_data(args = {})
    path = args.delete(:path) || "/blog"
    Rack::MockRequest.env_for(
      path,
      :params => args[:params] || {
        "controller" => "blog_posts",
        "action" => "show",
        "id" => "1"
      }
    ).merge(
      :controller => "BlogPostsController",
      :action => "show",
      :request_format => "html",
      :request_method => "GET",
      :status => "200",
      :view_runtime => 500,
      :db_runtime => 500,
      :metadata => { :key => "value" }
    ).merge(args)
  end

  def background_env_with_data(args = {})
    {
      :class => "BackgroundJob",
      :method => "perform",
      :priority => 1,
      :attempts => 0,
      :queue => "default",
      :queue_start => fixed_time - 10.0
    }.merge(args)
  end
end

Version data entries

157 entries across 157 versions & 1 rubygems

Version Path
appsignal-2.10.12 spec/support/helpers/env_helpers.rb
appsignal-2.10.12-java spec/support/helpers/env_helpers.rb
appsignal-2.10.11 spec/support/helpers/env_helpers.rb
appsignal-2.10.11-java spec/support/helpers/env_helpers.rb
appsignal-2.10.10 spec/support/helpers/env_helpers.rb
appsignal-2.10.10-java spec/support/helpers/env_helpers.rb
appsignal-2.10.9 spec/support/helpers/env_helpers.rb
appsignal-2.10.9-java spec/support/helpers/env_helpers.rb
appsignal-2.10.9.beta.1-java spec/support/helpers/env_helpers.rb
appsignal-2.10.9.beta.1 spec/support/helpers/env_helpers.rb
appsignal-2.10.8 spec/support/helpers/env_helpers.rb
appsignal-2.10.8-java spec/support/helpers/env_helpers.rb
appsignal-2.10.7-java spec/support/helpers/env_helpers.rb
appsignal-2.10.7 spec/support/helpers/env_helpers.rb
appsignal-2.10.6-java spec/support/helpers/env_helpers.rb
appsignal-2.10.6 spec/support/helpers/env_helpers.rb
appsignal-2.10.6.beta.1-java spec/support/helpers/env_helpers.rb
appsignal-2.10.6.beta.1 spec/support/helpers/env_helpers.rb
appsignal-2.10.5-java spec/support/helpers/env_helpers.rb
appsignal-2.10.5 spec/support/helpers/env_helpers.rb