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.5.4-java spec/support/helpers/api_request_helper.rb
appsignal-3.5.4 spec/support/helpers/api_request_helper.rb
appsignal-3.5.3-java spec/support/helpers/api_request_helper.rb
appsignal-3.5.3 spec/support/helpers/api_request_helper.rb
appsignal-3.5.2-java spec/support/helpers/api_request_helper.rb
appsignal-3.5.2 spec/support/helpers/api_request_helper.rb
appsignal-3.5.1-java spec/support/helpers/api_request_helper.rb
appsignal-3.5.1 spec/support/helpers/api_request_helper.rb
appsignal-3.5.0-java spec/support/helpers/api_request_helper.rb
appsignal-3.5.0 spec/support/helpers/api_request_helper.rb
appsignal-3.4.16-java spec/support/helpers/api_request_helper.rb
appsignal-3.4.16 spec/support/helpers/api_request_helper.rb
appsignal-3.4.15-java spec/support/helpers/api_request_helper.rb
appsignal-3.4.15 spec/support/helpers/api_request_helper.rb
appsignal-3.4.14-java spec/support/helpers/api_request_helper.rb
appsignal-3.4.14 spec/support/helpers/api_request_helper.rb
appsignal-3.4.13-java spec/support/helpers/api_request_helper.rb
appsignal-3.4.13 spec/support/helpers/api_request_helper.rb
appsignal-3.4.12-java spec/support/helpers/api_request_helper.rb
appsignal-3.4.12 spec/support/helpers/api_request_helper.rb