Sha256: 4be73bb9ba64ad2fd4105ab1fa299681d2b39868faecd313e41e95d4c2d1d462

Contents?: true

Size: 407 Bytes

Versions: 2

Compression:

Stored size: 407 Bytes

Contents

require 'rails_helper'

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

    it 'updates the resource' do
      expect {
        delete "/<%= api_namespace %>/v1/<%= type %>/#{<%= file_name %>.id}"
      }.to change { <%= model_klass %>.count }.by(-1)

      expect(response.status).to eq(204)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
jsonapi_compliable-0.11.0 lib/generators/jsonapi/templates/destroy_request_spec.rb.erb
jsonapi_compliable-0.10.9 lib/generators/jsonapi/templates/destroy_request_spec.rb.erb