diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-07 03:07:51 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-07 03:07:51 +0300 |
commit | 4e375367b78bb44bd00957522cd9fc3e6d403fef (patch) | |
tree | 059b1ce541e4128bf03683407d7b5bbbc2094ed5 /spec/lib/gitlab/github_import | |
parent | 99ddca0d88f1e4e49d61b1aa9d41b5785528d1dc (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/github_import')
6 files changed, 18 insertions, 15 deletions
diff --git a/spec/lib/gitlab/github_import/importer/diff_note_importer_spec.rb b/spec/lib/gitlab/github_import/importer/diff_note_importer_spec.rb index 484458289af..66909976b43 100644 --- a/spec/lib/gitlab/github_import/importer/diff_note_importer_spec.rb +++ b/spec/lib/gitlab/github_import/importer/diff_note_importer_spec.rb @@ -144,9 +144,9 @@ describe Gitlab::GithubImport::Importer::DiffNoteImporter do describe '#find_merge_request_id' do it 'returns a merge request ID' do - expect_any_instance_of(Gitlab::GithubImport::IssuableFinder) - .to receive(:database_id) - .and_return(10) + expect_next_instance_of(Gitlab::GithubImport::IssuableFinder) do |instance| + expect(instance).to receive(:database_id).and_return(10) + end expect(importer.find_merge_request_id).to eq(10) end diff --git a/spec/lib/gitlab/github_import/importer/label_links_importer_spec.rb b/spec/lib/gitlab/github_import/importer/label_links_importer_spec.rb index 19d40b2f380..9c02b0e280f 100644 --- a/spec/lib/gitlab/github_import/importer/label_links_importer_spec.rb +++ b/spec/lib/gitlab/github_import/importer/label_links_importer_spec.rb @@ -74,9 +74,9 @@ describe Gitlab::GithubImport::Importer::LabelLinksImporter do describe '#find_target_id' do it 'returns the ID of the issuable to create the label link for' do - expect_any_instance_of(Gitlab::GithubImport::IssuableFinder) - .to receive(:database_id) - .and_return(10) + expect_next_instance_of(Gitlab::GithubImport::IssuableFinder) do |instance| + expect(instance).to receive(:database_id).and_return(10) + end expect(importer.find_target_id).to eq(10) end diff --git a/spec/lib/gitlab/github_import/importer/labels_importer_spec.rb b/spec/lib/gitlab/github_import/importer/labels_importer_spec.rb index 2dcf1433154..16326da9ca4 100644 --- a/spec/lib/gitlab/github_import/importer/labels_importer_spec.rb +++ b/spec/lib/gitlab/github_import/importer/labels_importer_spec.rb @@ -50,8 +50,9 @@ describe Gitlab::GithubImport::Importer::LabelsImporter, :clean_gitlab_redis_cac describe '#build_labels_cache' do it 'builds the labels cache' do - expect_any_instance_of(Gitlab::GithubImport::LabelFinder) - .to receive(:build_cache) + expect_next_instance_of(Gitlab::GithubImport::LabelFinder) do |instance| + expect(instance).to receive(:build_cache) + end importer.build_labels_cache end diff --git a/spec/lib/gitlab/github_import/importer/milestones_importer_spec.rb b/spec/lib/gitlab/github_import/importer/milestones_importer_spec.rb index eaf63e0e11b..294599c02f4 100644 --- a/spec/lib/gitlab/github_import/importer/milestones_importer_spec.rb +++ b/spec/lib/gitlab/github_import/importer/milestones_importer_spec.rb @@ -80,8 +80,9 @@ describe Gitlab::GithubImport::Importer::MilestonesImporter, :clean_gitlab_redis describe '#build_milestones_cache' do it 'builds the milestones cache' do - expect_any_instance_of(Gitlab::GithubImport::MilestoneFinder) - .to receive(:build_cache) + expect_next_instance_of(Gitlab::GithubImport::MilestoneFinder) do |instance| + expect(instance).to receive(:build_cache) + end importer.build_milestones_cache end diff --git a/spec/lib/gitlab/github_import/importer/note_importer_spec.rb b/spec/lib/gitlab/github_import/importer/note_importer_spec.rb index d2b8ba186c8..816041b771b 100644 --- a/spec/lib/gitlab/github_import/importer/note_importer_spec.rb +++ b/spec/lib/gitlab/github_import/importer/note_importer_spec.rb @@ -143,9 +143,9 @@ describe Gitlab::GithubImport::Importer::NoteImporter do describe '#find_noteable_id' do it 'returns the ID of the noteable' do - expect_any_instance_of(Gitlab::GithubImport::IssuableFinder) - .to receive(:database_id) - .and_return(10) + expect_next_instance_of(Gitlab::GithubImport::IssuableFinder) do |instance| + expect(instance).to receive(:database_id).and_return(10) + end expect(importer.find_noteable_id).to eq(10) end diff --git a/spec/lib/gitlab/github_import/sequential_importer_spec.rb b/spec/lib/gitlab/github_import/sequential_importer_spec.rb index 8b1e8fbf3b7..256155dea03 100644 --- a/spec/lib/gitlab/github_import/sequential_importer_spec.rb +++ b/spec/lib/gitlab/github_import/sequential_importer_spec.rb @@ -9,8 +9,9 @@ describe Gitlab::GithubImport::SequentialImporter do project = double(:project, id: 1, repository: repository) importer = described_class.new(project, token: 'foo') - expect_any_instance_of(Gitlab::GithubImport::Importer::RepositoryImporter) - .to receive(:execute) + expect_next_instance_of(Gitlab::GithubImport::Importer::RepositoryImporter) do |instance| + expect(instance).to receive(:execute) + end described_class::SEQUENTIAL_IMPORTERS.each do |klass| instance = double(:instance) |