diff options
Diffstat (limited to 'spec/lib/gitlab/github_import/importer/label_links_importer_spec.rb')
-rw-r--r-- | spec/lib/gitlab/github_import/importer/label_links_importer_spec.rb | 27 |
1 files changed, 6 insertions, 21 deletions
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 e68849755b2..e005d8eda84 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 @@ -36,26 +36,11 @@ RSpec.describe Gitlab::GithubImport::Importer::LabelLinksImporter do expect(importer) .to receive(:find_target_id) - .and_return(1) + .and_return(4) - freeze_time do - expect(ApplicationRecord) - .to receive(:legacy_bulk_insert) - .with( - LabelLink.table_name, - [ - { - label_id: 2, - target_id: 1, - target_type: Issue, - created_at: Time.zone.now, - updated_at: Time.zone.now - } - ] - ) + expect(LabelLink).to receive(:bulk_insert!) - importer.create_labels - end + importer.create_labels end it 'does not insert label links for non-existing labels' do @@ -64,9 +49,9 @@ RSpec.describe Gitlab::GithubImport::Importer::LabelLinksImporter do .with('bug') .and_return(nil) - expect(ApplicationRecord) - .to receive(:legacy_bulk_insert) - .with(LabelLink.table_name, []) + expect(LabelLink) + .to receive(:bulk_insert!) + .with([]) importer.create_labels end |