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

detect_repository_languages_worker_spec.rb « workers « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 755eb8dbf6b19915856398e3584a8891877e57e1 (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
# frozen_string_literal: true

require 'spec_helper'

describe DetectRepositoryLanguagesWorker do
  set(:project) { create(:project) }

  subject { described_class.new }

  describe '#perform' do
    it 'calls de DetectRepositoryLanguages service' do
      service = double
      allow(::Projects::DetectRepositoryLanguagesService).to receive(:new).and_return(service)
      expect(service).to receive(:execute)

      subject.perform(project.id)
    end

    context 'when invalid ids are used' do
      it 'does not raise when the project could not be found' do
        expect do
          subject.perform(-1)
        end.not_to raise_error
      end
    end
  end
end