Sha256: 7fb22af05339ab9335e31322a2037974ef5a4952600b8d80e33cf095a41ba71a

Contents?: true

Size: 585 Bytes

Versions: 20

Compression:

Stored size: 585 Bytes

Contents

require 'rails_helper'

RSpec.describe "<%= file_name.pluralize %>#index", type: :request do
  context 'basic fetch' do
    let!(:<%= file_name %>1) { create(:<%= file_name %>) }
    let!(:<%= file_name %>2) { create(:<%= file_name %>) }

    it 'serializes the list correctly' do
      get "/api/v1/<%= file_name.pluralize %>"

      expect(json_ids(true)).to match_array([<%= file_name %>1.id, <%= file_name %>2.id])
      assert_payload(:<%= file_name %>, <%= file_name %>1, json_items[0])
      assert_payload(:<%= file_name %>, <%= file_name %>2, json_items[1])
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
jsonapi_compliable-0.10.3 lib/generators/jsonapi/templates/index_request_spec.rb.erb
jsonapi_compliable-0.10.2 lib/generators/jsonapi/templates/index_request_spec.rb.erb
jsonapi_compliable-0.10.1 lib/generators/jsonapi/templates/index_request_spec.rb.erb
jsonapi_compliable-0.10.0 lib/generators/jsonapi/templates/index_request_spec.rb.erb
jsonapi_compliable-0.9.2 lib/generators/jsonapi/templates/index_request_spec.rb.erb
jsonapi_compliable-0.9.1 lib/generators/jsonapi/templates/index_request_spec.rb.erb
jsonapi_compliable-0.9.0 lib/generators/jsonapi/templates/index_request_spec.rb.erb
jsonapi_compliable-0.8.0 lib/generators/jsonapi/templates/index_request_spec.rb.erb
jsonapi_compliable-0.7.9 lib/generators/jsonapi/templates/index_request_spec.rb.erb
jsonapi_compliable-0.7.8 lib/generators/jsonapi/templates/index_request_spec.rb.erb
jsonapi_compliable-0.7.7 lib/generators/jsonapi/templates/index_request_spec.rb.erb
jsonapi_compliable-0.7.6 lib/generators/jsonapi/templates/index_request_spec.rb.erb
jsonapi_compliable-0.7.5 lib/generators/jsonapi/templates/index_request_spec.rb.erb
jsonapi_compliable-0.7.4 lib/generators/jsonapi/templates/index_request_spec.rb.erb
jsonapi_compliable-0.7.3 lib/generators/jsonapi/templates/index_request_spec.rb.erb
jsonapi_compliable-0.7.2 lib/generators/jsonapi/templates/index_request_spec.rb.erb
jsonapi_compliable-0.6.13 lib/generators/jsonapi/templates/index_request_spec.rb.erb
jsonapi_compliable-0.6.12 lib/generators/jsonapi/templates/index_request_spec.rb.erb
jsonapi_compliable-0.6.11 lib/generators/jsonapi/templates/index_request_spec.rb.erb
jsonapi_compliable-0.6.10 lib/generators/jsonapi/templates/index_request_spec.rb.erb