Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib/gitlab/github_import/importer/single_endpoint_issue_events_importer_spec.rb')
-rw-r--r--spec/lib/gitlab/github_import/importer/single_endpoint_issue_events_importer_spec.rb27
1 files changed, 18 insertions, 9 deletions
diff --git a/spec/lib/gitlab/github_import/importer/single_endpoint_issue_events_importer_spec.rb b/spec/lib/gitlab/github_import/importer/single_endpoint_issue_events_importer_spec.rb
index dde730d46d2..91f89f0779c 100644
--- a/spec/lib/gitlab/github_import/importer/single_endpoint_issue_events_importer_spec.rb
+++ b/spec/lib/gitlab/github_import/importer/single_endpoint_issue_events_importer_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-RSpec.describe Gitlab::GithubImport::Importer::SingleEndpointIssueEventsImporter do
+RSpec.describe Gitlab::GithubImport::Importer::SingleEndpointIssueEventsImporter, feature_category: :importers do
let(:client) { double }
let_it_be(:project) { create(:project, :import_started, import_source: 'http://somegithub.com') }
@@ -101,14 +101,10 @@ RSpec.describe Gitlab::GithubImport::Importer::SingleEndpointIssueEventsImporter
let(:page_counter) { instance_double(Gitlab::GithubImport::PageCounter) }
before do
- allow(client).to receive(:each_page)
- .once
- .with(
- :issue_timeline,
- project.import_source,
- issuable.iid,
- { state: 'all', sort: 'created', direction: 'asc', page: 1 }
- ).and_yield(page)
+ allow(Gitlab::Redis::SharedState).to receive(:with).and_return('OK')
+ allow(client).to receive(:each_page).once.with(:issue_timeline,
+ project.import_source, issuable.iid, { state: 'all', sort: 'created', direction: 'asc', page: 1 }
+ ).and_yield(page)
end
context 'with issues' do
@@ -192,5 +188,18 @@ RSpec.describe Gitlab::GithubImport::Importer::SingleEndpointIssueEventsImporter
expect(counter).to eq 0
end
end
+
+ context 'when event is not supported' do
+ let(:issue_event) do
+ struct = Struct.new(:id, :event, :created_at, :issue, keyword_init: true)
+ struct.new(id: 1, event: 'not_supported_event', created_at: '2022-04-26 18:30:53 UTC')
+ end
+
+ it "doesn't process this event" do
+ counter = 0
+ subject.each_object_to_import { counter += 1 }
+ expect(counter).to eq 0
+ end
+ end
end
end