summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/github_import/importer/issue_and_label_links_importer_spec.rb
blob: 49a76fb5e6bae00cf82f6d386f565e53f24c2b9c (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
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Gitlab::GithubImport::Importer::IssueAndLabelLinksImporter do
  describe '#execute' do
    it 'imports an issue and its labels' do
      issue = double(:issue)
      project = double(:project)
      client = double(:client)
      label_links_instance = double(:label_links_importer)
      importer = described_class.new(issue, project, client)

      expect(Gitlab::GithubImport::Importer::IssueImporter)
        .to receive(:import_if_issue)
        .with(issue, project, client)

      expect(Gitlab::GithubImport::Importer::LabelLinksImporter)
        .to receive(:new)
        .with(issue, project, client)
        .and_return(label_links_instance)

      expect(label_links_instance)
        .to receive(:execute)

      importer.execute
    end
  end
end