Sha256: 8e2fa56959d3db4d862894f2a56302c3b5e568f1f95cdc24d7d5c2eebdd6fa75

Contents?: true

Size: 440 Bytes

Versions: 3

Compression:

Stored size: 440 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

RSpec.describe 'JSON type' do
  it 'coerces JSON custom type', type: :feature do
    create(:product, name: 'Shirt')

    post '/graphql',
      params: {
        query: "{ products(query: { search: { name_cont: \"Shirt\" } }) { nodes { name } } }"
      },
      headers: headers

    expect(JSON.parse(response.body).dig(*%w[data products nodes])[0]['name']).to eq('Shirt')
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
solidus_graphql_api-0.3.1 spec/integration/types/json_spec.rb
solidus_graphql_api-0.3.0 spec/integration/types/json_spec.rb
solidus_graphql_api-0.2.0 spec/integration/types/json_spec.rb