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