diff options
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.rb | 9 |
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) |