Sha256: 2004cdff618ac8892d854a2cb24725024839ab0ee82e463ea1a982b2175c85a2
Contents?: true
Size: 636 Bytes
Versions: 12
Compression:
Stored size: 636 Bytes
Contents
require 'rails_helper' RSpec.describe "<%= type %>#index", type: :request do let(:params) { {} } subject(:make_request) do jsonapi_get "/<%= api_namespace %>/v1/<%= 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 eq(['<%= type %>']) expect(d.map(&:id)).to match_array([<%= var %>1.id, <%= var %>2.id]) end end end
Version data entries
12 entries across 12 versions & 1 rubygems