Sha256: f4626d0130cc71a79a7a20ae62e2849dc6b0d32b9bc56c9e3ee122fdfe7b9697
Contents?: true
Size: 714 Bytes
Versions: 14
Compression:
Stored size: 714 Bytes
Contents
# frozen_string_literal: true 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') send_request(path, :post) end def get_request(path = '/api/v1/graphql_auth') send_request(path, :get) end def send_request(path, method) if Rails::VERSION::MAJOR >= 5 public_send(method, path, **graphql_params) else public_send(method, path, *graphql_params) end end end
Version data entries
14 entries across 14 versions & 1 rubygems