Sha256: a49454d117d0f53602ccd49783d95e46c2abdac0626cabc634a91d28305ef6d5

Contents?: true

Size: 628 Bytes

Versions: 13

Compression:

Stored size: 628 Bytes

Contents

# frozen_string_literal: true

require 'rails_helper'

RSpec.describe GraphqlRouter do
  subject(:schema) { described_class.graphql_schema }

  describe '#to_definition' do
    subject(:to_definition) { schema.to_definition.strip }

    let(:schema_dump_path) { Rails.root.join('spec', 'fixtures', 'graphql_schema.graphql') }
    let(:previous_definition) { File.read(schema_dump_path).strip }

    it 'returns correct structure' do
      # if you need to update saved_schema, run rake task:
      #   $ RAILS_ENV=test bin/rake graphql_rails:schema:dump

      expect(to_definition).to eq(previous_definition)
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
graphql_rails-3.0.0 lib/generators/graphql_rails/templates/graphql_router_spec.erb
graphql_rails-2.4.0 lib/generators/graphql_rails/templates/graphql_router_spec.erb
graphql_rails-2.3.0 lib/generators/graphql_rails/templates/graphql_router_spec.erb
graphql_rails-2.2.0 lib/generators/graphql_rails/templates/graphql_router_spec.erb
graphql_rails-2.1.0 lib/generators/graphql_rails/templates/graphql_router_spec.erb
graphql_rails-2.0.0 lib/generators/graphql_rails/templates/graphql_router_spec.erb
graphql_rails-1.2.6 lib/generators/graphql_rails/templates/graphql_router_spec.erb
graphql_rails-1.2.4 lib/generators/graphql_rails/templates/graphql_router_spec.erb
graphql_rails-1.2.3 lib/generators/graphql_rails/templates/graphql_router_spec.erb
graphql_rails-1.2.2 lib/generators/graphql_rails/templates/graphql_router_spec.erb
graphql_rails-1.2.1 lib/generators/graphql_rails/templates/graphql_router_spec.erb
graphql_rails-1.2.0 lib/generators/graphql_rails/templates/graphql_router_spec.erb
graphql_rails-1.1.0 lib/generators/graphql_rails/templates/graphql_router_spec.erb