summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/legacy_github_import/importer_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib/gitlab/legacy_github_import/importer_spec.rb')
-rw-r--r--spec/lib/gitlab/legacy_github_import/importer_spec.rb19
1 files changed, 10 insertions, 9 deletions
diff --git a/spec/lib/gitlab/legacy_github_import/importer_spec.rb b/spec/lib/gitlab/legacy_github_import/importer_spec.rb
index 6bc3792eb22..a0c664da185 100644
--- a/spec/lib/gitlab/legacy_github_import/importer_spec.rb
+++ b/spec/lib/gitlab/legacy_github_import/importer_spec.rb
@@ -13,21 +13,22 @@ describe Gitlab::LegacyGithubImport::Importer do
expected_called = [
:import_labels, :import_milestones, :import_pull_requests, :import_issues,
- :import_wiki, :import_releases, :handle_errors
+ :import_wiki, :import_releases, :handle_errors,
+ [:import_comments, :issues],
+ [:import_comments, :pull_requests]
]
expected_called -= expected_not_called
aggregate_failures do
- expected_called.each do |method_name|
- expect(importer).to receive(method_name)
+ expected_called.each do |method_name, arg|
+ base_expectation = proc { expect(importer).to receive(method_name) }
+ arg ? base_expectation.call.with(arg) : base_expectation.call
end
- expect(importer).to receive(:import_comments).with(:issues)
- expect(importer).to receive(:import_comments).with(:pull_requests)
-
- expected_not_called.each do |method_name|
- expect(importer).not_to receive(method_name)
+ expected_not_called.each do |method_name, arg|
+ base_expectation = proc { expect(importer).not_to receive(method_name) }
+ arg ? base_expectation.call.with(arg) : base_expectation.call
end
end
@@ -289,7 +290,7 @@ describe Gitlab::LegacyGithubImport::Importer do
end
it_behaves_like 'Gitlab::LegacyGithubImport::Importer#execute' do
- let(:expected_not_called) { [:import_releases] }
+ let(:expected_not_called) { [:import_releases, [:import_comments, :pull_requests]] }
end
it_behaves_like 'Gitlab::LegacyGithubImport::Importer#execute an error occurs'
it_behaves_like 'Gitlab::LegacyGithubImport unit-testing'