Sha256: 0c61700434c6502cb7efee8c49b4ba2d47260f1e6ef37d6e3f39d57b6acbd1f2

Contents?: true

Size: 1.12 KB

Versions: 20

Compression:

Stored size: 1.12 KB

Contents

# frozen_string_literal: true

require 'spec_helper'

RSpec.describe GlobalRegistry::Bindings::Workers::DeleteEntityWorker do
  context 'entity 22527d88-3cba-11e7-b876-129bd0521531' do
    context 'valid global_registry_id' do
      let!(:request) do
        stub_request(:delete, 'https://backend.global-registry.org/entities/22527d88-3cba-11e7-b876-129bd0521531')
          .to_return(status: 200)
      end

      it 'should delete the entity' do
        worker = GlobalRegistry::Bindings::Workers::DeleteEntityWorker.new
        worker.perform('22527d88-3cba-11e7-b876-129bd0521531')
        expect(request).to have_been_requested.once
      end
    end

    context 'unknown global_registry_id' do
      let!(:request) do
        stub_request(:delete, 'https://backend.global-registry.org/entities/22527d88-3cba-11e7-b876-129bd0521531')
          .to_return(status: 404)
      end

      it 'should delete the entity' do
        worker = GlobalRegistry::Bindings::Workers::DeleteEntityWorker.new
        worker.perform('22527d88-3cba-11e7-b876-129bd0521531')
        expect(request).to have_been_requested.once
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
global-registry-bindings-0.6.2 spec/workers/delete_gr_entity_worker_spec.rb
global-registry-bindings-0.6.1 spec/workers/delete_gr_entity_worker_spec.rb
global-registry-bindings-0.6.0 spec/workers/delete_gr_entity_worker_spec.rb
global-registry-bindings-0.5.0 spec/workers/delete_gr_entity_worker_spec.rb
global-registry-bindings-0.4.0 spec/workers/delete_gr_entity_worker_spec.rb
global-registry-bindings-0.3.3 spec/workers/delete_gr_entity_worker_spec.rb
global-registry-bindings-0.3.2 spec/workers/delete_gr_entity_worker_spec.rb
global-registry-bindings-0.3.1 spec/workers/delete_gr_entity_worker_spec.rb
global-registry-bindings-0.3.0 spec/workers/delete_gr_entity_worker_spec.rb
global-registry-bindings-0.2.0 spec/workers/delete_gr_entity_worker_spec.rb
global-registry-bindings-0.1.9 spec/workers/delete_gr_entity_worker_spec.rb
global-registry-bindings-0.1.8 spec/workers/delete_gr_entity_worker_spec.rb
global-registry-bindings-0.1.7 spec/workers/delete_gr_entity_worker_spec.rb
global-registry-bindings-0.1.6 spec/workers/delete_gr_entity_worker_spec.rb
global-registry-bindings-0.1.5 spec/workers/delete_gr_entity_worker_spec.rb
global-registry-bindings-0.1.4 spec/workers/delete_gr_entity_worker_spec.rb
global-registry-bindings-0.1.3 spec/workers/delete_gr_entity_worker_spec.rb
global-registry-bindings-0.1.2 spec/workers/delete_gr_entity_worker_spec.rb
global-registry-bindings-0.1.1 spec/workers/delete_gr_entity_worker_spec.rb
global-registry-bindings-0.1.0 spec/workers/delete_gr_entity_worker_spec.rb