debian-mirror-gitlab/spec/services/ci/runners/unregister_runner_service_spec.rb
2023-03-04 22:38:38 +05:30

18 lines
504 B
Ruby

# frozen_string_literal: true
require 'spec_helper'
RSpec.describe ::Ci::Runners::UnregisterRunnerService, '#execute', feature_category: :runner_fleet do
subject(:execute) { described_class.new(runner, 'some_token').execute }
let(:runner) { create(:ci_runner) }
it 'destroys runner' do
expect(runner).to receive(:destroy).once.and_call_original
expect do
expect(execute).to be_success
end.to change { Ci::Runner.count }.by(-1)
expect(runner[:errors]).to be_nil
end
end