debian-mirror-gitlab/spec/lib/gitlab/github_import/importer/issue_and_label_links_importer_spec.rb
2020-08-09 17:44:08 +05:30

30 lines
830 B
Ruby

# 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