Welcome to mirror list, hosted at ThFree Co, Russian Federation.

generate_distribution_service_spec.rb « debian « packages « services « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 27206b847e42dbc9c99c380c31d606c3da3be480 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Packages::Debian::GenerateDistributionService, feature_category: :package_registry do
  include_context 'with published Debian package'

  let(:service) { described_class.new(distribution) }

  [:project, :group].each do |container_type|
    context "for #{container_type}" do
      include_context 'with Debian distribution', container_type

      describe '#execute' do
        subject { service.execute }

        let(:subject2) { described_class.new(distribution).execute }
        let(:subject3) { described_class.new(distribution).execute }

        it_behaves_like 'Generate Debian Distribution and component files'
      end

      describe '#lease_key' do
        subject { service.send(:lease_key) }

        let(:prefix) { "packages:debian:generate_distribution_service:" }

        it 'returns an unique key' do
          is_expected.to eq "#{prefix}#{container_type}_distribution:#{distribution.id}"
        end
      end
    end
  end
end