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

replicate_service_spec.rb « labels « services « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 189a3bd08858ec6dedae36e94802be350124d15d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
require 'spec_helper'

describe Labels::ReplicateService, services: true do
  describe '#execute' do
    let(:group)   { create(:group) }
    let(:project) { create(:empty_project, group: group) }

    subject(:service) { described_class.new(project, double) }

    it 'replicates global labels' do
      create_list(:global_label, 2)

      expect { service.execute }.to change(project.labels, :count).by(2)
    end

    it 'replicates group labels' do
      create_list(:group_label, 2, subject: group)

      expect { service.execute }.to change(project.labels, :count).by(2)
    end
  end
end