diff options
Diffstat (limited to 'spec/lib/gitlab/github_import/importer/attachments')
4 files changed, 12 insertions, 4 deletions
diff --git a/spec/lib/gitlab/github_import/importer/attachments/issues_importer_spec.rb b/spec/lib/gitlab/github_import/importer/attachments/issues_importer_spec.rb index 7890561bf2d..b44f1ec85f3 100644 --- a/spec/lib/gitlab/github_import/importer/attachments/issues_importer_spec.rb +++ b/spec/lib/gitlab/github_import/importer/attachments/issues_importer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Gitlab::GithubImport::Importer::Attachments::IssuesImporter do +RSpec.describe Gitlab::GithubImport::Importer::Attachments::IssuesImporter, feature_category: :importers do subject(:importer) { described_class.new(project, client) } let_it_be(:project) { create(:project) } @@ -17,6 +17,7 @@ RSpec.describe Gitlab::GithubImport::Importer::Attachments::IssuesImporter do let(:importer_attrs) { [instance_of(Gitlab::GithubImport::Representation::NoteText), project, client] } it 'imports each project issue attachments' do + expect(project.issues).to receive(:id_not_in).with([]).and_return(project.issues) expect(project.issues).to receive(:select).with(:id, :description, :iid).and_call_original expect_next_instances_of( @@ -32,6 +33,7 @@ RSpec.describe Gitlab::GithubImport::Importer::Attachments::IssuesImporter do it "doesn't import this issue attachments" do importer.mark_as_imported(issue_1) + expect(project.issues).to receive(:id_not_in).with([issue_1.id.to_s]).and_call_original expect_next_instance_of( Gitlab::GithubImport::Importer::NoteAttachmentsImporter, *importer_attrs ) do |note_attachments_importer| diff --git a/spec/lib/gitlab/github_import/importer/attachments/merge_requests_importer_spec.rb b/spec/lib/gitlab/github_import/importer/attachments/merge_requests_importer_spec.rb index e5aa17dd81e..381cb17bb52 100644 --- a/spec/lib/gitlab/github_import/importer/attachments/merge_requests_importer_spec.rb +++ b/spec/lib/gitlab/github_import/importer/attachments/merge_requests_importer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Gitlab::GithubImport::Importer::Attachments::MergeRequestsImporter do +RSpec.describe Gitlab::GithubImport::Importer::Attachments::MergeRequestsImporter, feature_category: :importers do subject(:importer) { described_class.new(project, client) } let_it_be(:project) { create(:project) } @@ -17,6 +17,7 @@ RSpec.describe Gitlab::GithubImport::Importer::Attachments::MergeRequestsImporte let(:importer_attrs) { [instance_of(Gitlab::GithubImport::Representation::NoteText), project, client] } it 'imports each project merge request attachments' do + expect(project.merge_requests).to receive(:id_not_in).with([]).and_return(project.merge_requests) expect(project.merge_requests).to receive(:select).with(:id, :description, :iid).and_call_original expect_next_instances_of( @@ -32,6 +33,7 @@ RSpec.describe Gitlab::GithubImport::Importer::Attachments::MergeRequestsImporte it "doesn't import this merge request attachments" do importer.mark_as_imported(merge_request_1) + expect(project.merge_requests).to receive(:id_not_in).with([merge_request_1.id.to_s]).and_call_original expect_next_instance_of( Gitlab::GithubImport::Importer::NoteAttachmentsImporter, *importer_attrs ) do |note_attachments_importer| diff --git a/spec/lib/gitlab/github_import/importer/attachments/notes_importer_spec.rb b/spec/lib/gitlab/github_import/importer/attachments/notes_importer_spec.rb index 7ed353e1b71..5b3ad032702 100644 --- a/spec/lib/gitlab/github_import/importer/attachments/notes_importer_spec.rb +++ b/spec/lib/gitlab/github_import/importer/attachments/notes_importer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Gitlab::GithubImport::Importer::Attachments::NotesImporter do +RSpec.describe Gitlab::GithubImport::Importer::Attachments::NotesImporter, feature_category: :importers do subject(:importer) { described_class.new(project, client) } let_it_be(:project) { create(:project) } @@ -18,6 +18,7 @@ RSpec.describe Gitlab::GithubImport::Importer::Attachments::NotesImporter do let(:importer_attrs) { [instance_of(Gitlab::GithubImport::Representation::NoteText), project, client] } it 'imports each project user note' do + expect(project.notes).to receive(:id_not_in).with([]).and_call_original expect(Gitlab::GithubImport::Importer::NoteAttachmentsImporter).to receive(:new) .with(*importer_attrs).twice.and_return(importer_stub) expect(importer_stub).to receive(:execute).twice @@ -29,6 +30,7 @@ RSpec.describe Gitlab::GithubImport::Importer::Attachments::NotesImporter do it "doesn't import this note" do importer.mark_as_imported(note_1) + expect(project.notes).to receive(:id_not_in).with([note_1.id.to_s]).and_call_original expect(Gitlab::GithubImport::Importer::NoteAttachmentsImporter).to receive(:new) .with(*importer_attrs).once.and_return(importer_stub) expect(importer_stub).to receive(:execute).once diff --git a/spec/lib/gitlab/github_import/importer/attachments/releases_importer_spec.rb b/spec/lib/gitlab/github_import/importer/attachments/releases_importer_spec.rb index e1b009c3eeb..c1c19c40afb 100644 --- a/spec/lib/gitlab/github_import/importer/attachments/releases_importer_spec.rb +++ b/spec/lib/gitlab/github_import/importer/attachments/releases_importer_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Gitlab::GithubImport::Importer::Attachments::ReleasesImporter do +RSpec.describe Gitlab::GithubImport::Importer::Attachments::ReleasesImporter, feature_category: :importers do subject(:importer) { described_class.new(project, client) } let_it_be(:project) { create(:project) } @@ -17,6 +17,7 @@ RSpec.describe Gitlab::GithubImport::Importer::Attachments::ReleasesImporter do let(:importer_attrs) { [instance_of(Gitlab::GithubImport::Representation::NoteText), project, client] } it 'imports each project release' do + expect(project.releases).to receive(:id_not_in).with([]).and_return(project.releases) expect(project.releases).to receive(:select).with(:id, :description, :tag).and_call_original expect(Gitlab::GithubImport::Importer::NoteAttachmentsImporter).to receive(:new) @@ -30,6 +31,7 @@ RSpec.describe Gitlab::GithubImport::Importer::Attachments::ReleasesImporter do it "doesn't import this release" do importer.mark_as_imported(release_1) + expect(project.releases).to receive(:id_not_in).with([release_1.id.to_s]).and_call_original expect(Gitlab::GithubImport::Importer::NoteAttachmentsImporter).to receive(:new) .with(*importer_attrs).once.and_return(importer_stub) expect(importer_stub).to receive(:execute).once |