Sha256: d5275934152f39e84d7dd9a92ae0101763820ccfda37894affb850533ff57b78

Contents?: true

Size: 794 Bytes

Versions: 16

Compression:

Stored size: 794 Bytes

Contents

# frozen_string_literal: true
require 'test_helper'

module GraphQL
  class HTTPClientTest < Test::Unit::TestCase
    test '#headers uses the Base headers' do
      ShopifyAPI::Base.headers['X-Custom'] = 'abc'

      client = ShopifyAPI::GraphQL::HTTPClient.new('2019-07')

      assert_equal 'abc', client.headers({})['X-Custom']

      ShopifyAPI::Base.headers.delete('X-Custom')
    end

    test '#uri uses the Base site and the API version' do
      ShopifyAPI::Base.site = 'https://foo:bar@www.zombo.com'
      api_version = ShopifyAPI::ApiVersion.new(handle: '2019-07')

      client = ShopifyAPI::GraphQL::HTTPClient.new(api_version)
      expected_uri = URI('https://foo:bar@www.zombo.com/admin/api/2019-07/graphql.json')

      assert_equal expected_uri, client.uri
    end
  end
end

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
shopify_api-9.5.2 test/graphql/http_client_test.rb
ruby_shopify_api-1.2.0 test/graphql/http_client_test.rb
ruby_shopify_api-1.1.0 test/graphql/http_client_test.rb
ruby_shopify_api-1.0.0 test/graphql/http_client_test.rb
shopify_api-9.5.1 test/graphql/http_client_test.rb
shopify_api-9.5 test/graphql/http_client_test.rb
shopify_api-9.4.1 test/graphql/http_client_test.rb
shopify_api-9.4.0 test/graphql/http_client_test.rb
shopify_api-9.3.0 test/graphql/http_client_test.rb
shopify_api-9.2.0 test/graphql/http_client_test.rb
shopify_api-9.1.0 test/graphql/http_client_test.rb
shopify_api-9.0.4 test/graphql/http_client_test.rb
shopify_api-9.0.3 test/graphql/http_client_test.rb
shopify_api-9.0.2 test/graphql/http_client_test.rb
shopify_api-9.0.1 test/graphql/http_client_test.rb
shopify_api-9.0.0 test/graphql/http_client_test.rb