Sha256: 647114cbd3516c6e29b1d991c92400010f92798ef1a31be9cecf51adb82131a5

Contents?: true

Size: 402 Bytes

Versions: 16

Compression:

Stored size: 402 Bytes

Contents

require 'rails_helper'

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

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

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

Version data entries

16 entries across 16 versions & 1 rubygems

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