Sha256: e7ffb3e4e239b79a430fb443d6567aa179a8a36e616a03c89c76bc6982d8d494

Contents?: true

Size: 656 Bytes

Versions: 100

Compression:

Stored size: 656 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), response.body
      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

100 entries across 100 versions & 2 rubygems

Version Path
graphiti-1.7.6 deprecated_generators/graphiti/templates/index_request_spec.rb.erb
graphiti-1.7.5 deprecated_generators/graphiti/templates/index_request_spec.rb.erb
graphiti-1.7.4 deprecated_generators/graphiti/templates/index_request_spec.rb.erb
graphiti-1.7.3 deprecated_generators/graphiti/templates/index_request_spec.rb.erb
graphiti-1.7.2 deprecated_generators/graphiti/templates/index_request_spec.rb.erb
graphiti-1.7.1 deprecated_generators/graphiti/templates/index_request_spec.rb.erb
graphiti-1.7.0 deprecated_generators/graphiti/templates/index_request_spec.rb.erb
graphiti-1.6.4 deprecated_generators/graphiti/templates/index_request_spec.rb.erb
graphiti-1.6.3 deprecated_generators/graphiti/templates/index_request_spec.rb.erb
graphiti-1.6.2 deprecated_generators/graphiti/templates/index_request_spec.rb.erb
graphiti-1.6.1 deprecated_generators/graphiti/templates/index_request_spec.rb.erb
graphiti-1.6.0 deprecated_generators/graphiti/templates/index_request_spec.rb.erb
graphiti-1.5.3 deprecated_generators/graphiti/templates/index_request_spec.rb.erb
graphiti-1.5.2 deprecated_generators/graphiti/templates/index_request_spec.rb.erb
graphiti-1.5.1 deprecated_generators/graphiti/templates/index_request_spec.rb.erb
graphiti-1.5.0 deprecated_generators/graphiti/templates/index_request_spec.rb.erb
graphiti-1.4.0 deprecated_generators/graphiti/templates/index_request_spec.rb.erb
graphiti-1.3.9 deprecated_generators/graphiti/templates/index_request_spec.rb.erb
graphiti-1.3.8 deprecated_generators/graphiti/templates/index_request_spec.rb.erb
graphiti-1.3.7 deprecated_generators/graphiti/templates/index_request_spec.rb.erb