2019-12-26 22:10:19 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-07-28 23:09:34 +05:30
|
|
|
RSpec.describe Gitlab::GithubImport::Importer::IssueAndLabelLinksImporter do
|
2018-03-17 18:26:18 +05:30
|
|
|
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
|