Sha256: 8cf6a055a91755976a9c2729ee1656e10235087481dae2c8b2f02bf276afcecd

Contents?: true

Size: 588 Bytes

Versions: 410

Compression:

Stored size: 588 Bytes

Contents

module ApiRequestHelper
  def stub_api_request(config, path, body = nil)
    options = {
      :query => {
        :api_key => config[:push_api_key],
        :name => config[:name],
        :environment => config.env,
        :hostname => config[:hostname],
        :gem_version => Appsignal::VERSION
      },
      :headers => {
        "Content-Type" => "application/json; charset=UTF-8"
      }
    }
    body = Appsignal::Utils::JSON.generate(body) if body.is_a? Hash
    options[:body] = body if body
    stub_request(:post, "#{config[:endpoint]}/1/#{path}").with(options)
  end
end

Version data entries

410 entries across 410 versions & 1 rubygems

Version Path
appsignal-3.13.1-java spec/support/helpers/api_request_helper.rb
appsignal-3.13.1 spec/support/helpers/api_request_helper.rb
appsignal-3.13.1.alpha.1-java spec/support/helpers/api_request_helper.rb
appsignal-3.13.1.alpha.1 spec/support/helpers/api_request_helper.rb
appsignal-3.13.0-java spec/support/helpers/api_request_helper.rb
appsignal-3.13.0 spec/support/helpers/api_request_helper.rb
appsignal-3.12.6-java spec/support/helpers/api_request_helper.rb
appsignal-3.12.6 spec/support/helpers/api_request_helper.rb
appsignal-3.12.5-java spec/support/helpers/api_request_helper.rb
appsignal-3.12.5 spec/support/helpers/api_request_helper.rb
appsignal-3.12.4-java spec/support/helpers/api_request_helper.rb
appsignal-3.12.4 spec/support/helpers/api_request_helper.rb
appsignal-3.12.3-java spec/support/helpers/api_request_helper.rb
appsignal-3.12.3 spec/support/helpers/api_request_helper.rb
appsignal-3.12.2-java spec/support/helpers/api_request_helper.rb
appsignal-3.12.2 spec/support/helpers/api_request_helper.rb
appsignal-3.12.1-java spec/support/helpers/api_request_helper.rb
appsignal-3.12.1 spec/support/helpers/api_request_helper.rb
appsignal-3.12.0-java spec/support/helpers/api_request_helper.rb
appsignal-3.12.0 spec/support/helpers/api_request_helper.rb