Sha256: 9825324c7a6dbd9a9c03b62e2ac090d08ba6521fd2df71c3b5bbf6b7424eb1b7

Contents?: true

Size: 619 Bytes

Versions: 11

Compression:

Stored size: 619 Bytes

Contents

require 'rails_helper'

RSpec.describe 'Additional Queries' do
  include_context 'with graphql query request'

  let(:public_user) { create(:user, :confirmed) }

  context 'when using the user model' do
    let(:query) do
      <<-GRAPHQL
        query {
          publicUser(
            id: #{public_user.id}
          ) {
            email
            name
          }
        }
      GRAPHQL
    end

    before { post_request }

    it 'fetches a user by ID' do
      expect(json_response[:data][:publicUser]).to include(
        email: public_user.email,
        name:  public_user.name
      )
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
graphql_devise-0.12.3 spec/requests/mutations/additional_queries_spec.rb
graphql_devise-0.12.2 spec/requests/mutations/additional_queries_spec.rb
graphql_devise-0.12.1 spec/requests/mutations/additional_queries_spec.rb
graphql_devise-0.12.0 spec/requests/mutations/additional_queries_spec.rb
graphql_devise-0.11.4 spec/requests/mutations/additional_queries_spec.rb
graphql_devise-0.11.3 spec/requests/mutations/additional_queries_spec.rb
graphql_devise-0.11.2 spec/requests/mutations/additional_queries_spec.rb
graphql_devise-0.11.1 spec/requests/mutations/additional_queries_spec.rb
graphql_devise-0.11.0 spec/requests/mutations/additional_queries_spec.rb
graphql_devise-0.10.1 spec/requests/mutations/additional_queries_spec.rb
graphql_devise-0.10.0 spec/requests/mutations/additional_queries_spec.rb