Sha256: cd103789f1359560b1376a338f34559d08af5c9bf18cf1d2e82a84b4c0d7fadf

Contents?: true

Size: 801 Bytes

Versions: 2

Compression:

Stored size: 801 Bytes

Contents

require 'test_helper'

module GraphQL
  module Client
    module Query
      class QueryDocumentTest < Minitest::Test
        def setup
          @schema = GraphQLSchema.new(schema_fixture('schema.json'))
        end

        def test_new_creates_a_document_with_a_query_operation
          query_operation = QueryDocument.new(@schema)

          assert_equal query_operation, query_operation.document.operations['default']
          assert_instance_of QueryOperation, query_operation
        end

        def test_new_yields_query_operation
          query_operation_object = nil

          query_operation = QueryDocument.new(@schema) do |q|
            query_operation_object = q
          end

          assert_equal query_operation_object, query_operation
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
graphql_client-0.4.1 test/graphql_client/query/query_document_test.rb
graphql_client-0.3.3 test/graphql_client/query/query_document_test.rb