Sha256: 42100eae0981395c39e52525fb6f7515dc13163a8b9ed687943ee1df02b9ec2d

Contents?: true

Size: 1.08 KB

Versions: 6

Compression:

Stored size: 1.08 KB

Contents

# frozen_string_literal: true

require 'spec_helper'

RSpec.describe 'GlobalRegistry::Bindings::Workers' do
  describe 'DeleteGrEntityWorker' 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::DeleteGrEntityWorker.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::DeleteGrEntityWorker.new
        worker.perform('22527d88-3cba-11e7-b876-129bd0521531')
        expect(request).to have_been_requested.once
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
global-registry-bindings-0.0.6 spec/workers/delete_gr_entity_worker_spec.rb
global-registry-bindings-0.0.5 spec/workers/delete_gr_entity_worker_spec.rb
global-registry-bindings-0.0.4 spec/workers/delete_gr_entity_worker_spec.rb
global-registry-bindings-0.0.3 spec/workers/delete_gr_entity_worker_spec.rb
global-registry-bindings-0.0.2 spec/workers/delete_gr_entity_worker_spec.rb
global-registry-bindings-0.0.1 spec/workers/delete_gr_entity_worker_spec.rb