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.7.1-java spec/support/helpers/api_request_helper.rb
appsignal-3.7.1 spec/support/helpers/api_request_helper.rb
appsignal-3.7.0-java spec/support/helpers/api_request_helper.rb
appsignal-3.7.0 spec/support/helpers/api_request_helper.rb
appsignal-3.6.5-java spec/support/helpers/api_request_helper.rb
appsignal-3.6.5 spec/support/helpers/api_request_helper.rb
appsignal-3.6.4-java spec/support/helpers/api_request_helper.rb
appsignal-3.6.4 spec/support/helpers/api_request_helper.rb
appsignal-3.6.3-java spec/support/helpers/api_request_helper.rb
appsignal-3.6.3 spec/support/helpers/api_request_helper.rb
appsignal-3.6.2-java spec/support/helpers/api_request_helper.rb
appsignal-3.6.2 spec/support/helpers/api_request_helper.rb
appsignal-3.6.1-java spec/support/helpers/api_request_helper.rb
appsignal-3.6.1 spec/support/helpers/api_request_helper.rb
appsignal-3.6.0-java spec/support/helpers/api_request_helper.rb
appsignal-3.6.0 spec/support/helpers/api_request_helper.rb
appsignal-3.5.6-java spec/support/helpers/api_request_helper.rb
appsignal-3.5.6 spec/support/helpers/api_request_helper.rb
appsignal-3.5.5-java spec/support/helpers/api_request_helper.rb
appsignal-3.5.5 spec/support/helpers/api_request_helper.rb