Sha256: 19b10d7b643283be534f3e528ee26019210bf67e5d843776766ceab5986061c7
Contents?: true
Size: 743 Bytes
Versions: 20
Compression:
Stored size: 743 Bytes
Contents
require 'rails_helper' RSpec.describe "<%= type %>#update", type: :request do context 'basic update' do let!(:<%= file_name %>) { create(:<%= file_name %>) } let(:payload) do { data: { id: <%= file_name %>.id.to_s, type: '<%= type %>', attributes: { # ... your attrs here } } } end # Replace 'xit' with 'it' after adding attributes xit 'updates the resource' do expect { jsonapi_put "/api/v1/<%= type %>/#{<%= file_name %>.id}", payload }.to change { <%= file_name %>.reload.attributes } assert_payload(:<%= file_name %>, <%= file_name %>, json_item) # ... assert updates attributes ... end end end
Version data entries
20 entries across 20 versions & 1 rubygems