Sha256: 50847809eadaaa9b98f44f2826c16c7987b3722469792aed2182fbae6b296f8f

Contents?: true

Size: 641 Bytes

Versions: 33

Compression:

Stored size: 641 Bytes

Contents

require 'rails_helper'

RSpec.describe "<%= type %>#index", type: :request do
  let(:params) { {} }

  subject(:make_request) do
    jsonapi_get "<%= api_namespace %>/<%= type %>", params: params
  end

  describe 'basic fetch' do
    let!(:<%= var %>1) { create(:<%= var %>) }
    let!(:<%= var %>2) { create(:<%= var %>) }

    it 'works' do
      expect(<%= resource_class %>).to receive(:all).and_call_original
      make_request
      expect(response.status).to eq(200)
      expect(d.map(&:jsonapi_type).uniq).to match_array(['<%= type %>'])
      expect(d.map(&:id)).to match_array([<%= var %>1.id, <%= var %>2.id])
    end
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
graphiti-1.0.rc.4 lib/generators/graphiti/templates/index_request_spec.rb.erb
graphiti-1.0.rc.3 lib/generators/graphiti/templates/index_request_spec.rb.erb
graphiti-1.0.rc.2 lib/generators/graphiti/templates/index_request_spec.rb.erb
graphiti-1.0.rc.1 lib/generators/graphiti/templates/index_request_spec.rb.erb
graphiti-1.0.beta.23 lib/generators/graphiti/templates/index_request_spec.rb.erb
graphiti-1.0.beta.22 lib/generators/graphiti/templates/index_request_spec.rb.erb
graphiti-1.0.beta.21 lib/generators/graphiti/templates/index_request_spec.rb.erb
graphiti-1.0.beta.20 lib/generators/graphiti/templates/index_request_spec.rb.erb
graphiti-1.0.beta.19 lib/generators/graphiti/templates/index_request_spec.rb.erb
graphiti-1.0.beta.18 lib/generators/graphiti/templates/index_request_spec.rb.erb
graphiti-1.0.beta.17 lib/generators/graphiti/templates/index_request_spec.rb.erb
graphiti-1.0.beta.16 lib/generators/graphiti/templates/index_request_spec.rb.erb
graphiti-1.0.beta.15 lib/generators/graphiti/templates/index_request_spec.rb.erb
graphiti-1.0.beta.14 lib/generators/graphiti/templates/index_request_spec.rb.erb
graphiti-1.0.beta.13 lib/generators/graphiti/templates/index_request_spec.rb.erb
graphiti-1.0.beta.12 lib/generators/graphiti/templates/index_request_spec.rb.erb
graphiti-1.0.beta.11 lib/generators/graphiti/templates/index_request_spec.rb.erb
graphiti-1.0.beta.10 lib/generators/graphiti/templates/index_request_spec.rb.erb
graphiti-1.0.beta.9 lib/generators/graphiti/templates/index_request_spec.rb.erb
graphiti-1.0.beta.8 lib/generators/graphiti/templates/index_request_spec.rb.erb