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/pull_requests_importer_spec.rb')
-rw-r--r--spec/lib/gitlab/github_import/importer/pull_requests_importer_spec.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/spec/lib/gitlab/github_import/importer/pull_requests_importer_spec.rb b/spec/lib/gitlab/github_import/importer/pull_requests_importer_spec.rb
index 10e413fdfe5..1a0adbbe3a3 100644
--- a/spec/lib/gitlab/github_import/importer/pull_requests_importer_spec.rb
+++ b/spec/lib/gitlab/github_import/importer/pull_requests_importer_spec.rb
@@ -93,6 +93,10 @@ RSpec.describe Gitlab::GithubImport::Importer::PullRequestsImporter, feature_cat
end
describe '#parallel_import', :clean_gitlab_redis_cache do
+ before do
+ allow(Gitlab::Redis::SharedState).to receive(:with).and_return('OK')
+ end
+
it 'imports each note in parallel' do
importer = described_class.new(project, client)
@@ -112,9 +116,8 @@ RSpec.describe Gitlab::GithubImport::Importer::PullRequestsImporter, feature_cat
end
describe '#each_object_to_import', :clean_gitlab_redis_cache do
- let(:importer) { described_class.new(project, client) }
-
before do
+ allow(Gitlab::Redis::SharedState).to receive(:with).and_return('OK')
page = double(:page, objects: [pull_request], number: 1)
expect(client)
@@ -127,6 +130,8 @@ RSpec.describe Gitlab::GithubImport::Importer::PullRequestsImporter, feature_cat
.and_yield(page)
end
+ let(:importer) { described_class.new(project, client) }
+
it 'yields every pull request to the supplied block' do
expect { |b| importer.each_object_to_import(&b) }
.to yield_with_args(pull_request)