Sha256: 2e2af8662a2faea7739138f5dc516e73043078214686385509aecdc1342d254b

Contents?: true

Size: 497 Bytes

Versions: 23

Compression:

Stored size: 497 Bytes

Contents

RSpec.shared_context 'with graphql query request' do
  let(:headers)   { {} }
  let(:variables) { {} }
  let(:graphql_params) do
    if Rails::VERSION::MAJOR >= 5
      [{ params: { query: query, variables: variables }, headers: headers }]
    else
      [{ query: query, variables: variables }, headers]
    end
  end

  def post_request(path = '/api/v1/graphql_auth')
    post path, *graphql_params
  end

  def get_request(path = '/api/v1/graphql_auth')
    get path, *graphql_params
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
graphql_devise-0.4.0 spec/support/contexts/graphql_request.rb
graphql_devise-0.3.0 spec/support/contexts/graphql_request.rb
graphql_devise-0.2.0 spec/support/contexts/graphql_request.rb