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:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-11-19 11:27:35 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-11-19 11:27:35 +0300
commit7e9c479f7de77702622631cff2628a9c8dcbc627 (patch)
treec8f718a08e110ad7e1894510980d2155a6549197 /spec/services/jira_connect_subscriptions
parente852b0ae16db4052c1c567d9efa4facc81146e88 (diff)
Add latest changes from gitlab-org/gitlab@13-6-stable-eev13.6.0-rc42
Diffstat (limited to 'spec/services/jira_connect_subscriptions')
-rw-r--r--spec/services/jira_connect_subscriptions/create_service_spec.rb30
1 files changed, 30 insertions, 0 deletions
diff --git a/spec/services/jira_connect_subscriptions/create_service_spec.rb b/spec/services/jira_connect_subscriptions/create_service_spec.rb
index 77e758cf6fe..9750c671fa2 100644
--- a/spec/services/jira_connect_subscriptions/create_service_spec.rb
+++ b/spec/services/jira_connect_subscriptions/create_service_spec.rb
@@ -32,6 +32,36 @@ RSpec.describe JiraConnectSubscriptions::CreateService do
it 'returns success' do
expect(subject[:status]).to eq(:success)
end
+
+ context 'namespace has projects' do
+ let!(:project_1) { create(:project, group: group) }
+ let!(:project_2) { create(:project, group: group) }
+
+ before do
+ stub_const("#{described_class}::MERGE_REQUEST_SYNC_BATCH_SIZE", 1)
+ end
+
+ it 'starts workers to sync projects in batches with delay' do
+ allow(Atlassian::JiraConnect::Client).to receive(:generate_update_sequence_id).and_return(123)
+
+ expect(JiraConnect::SyncProjectWorker).to receive(:bulk_perform_in).with(1.minute, [[project_1.id, 123]])
+ expect(JiraConnect::SyncProjectWorker).to receive(:bulk_perform_in).with(2.minutes, [[project_2.id, 123]])
+
+ subject
+ end
+
+ context 'when the jira_connect_full_namespace_sync feature flag is disabled' do
+ before do
+ stub_feature_flags(jira_connect_full_namespace_sync: false)
+ end
+
+ specify do
+ expect(JiraConnect::SyncProjectWorker).not_to receive(:bulk_perform_in_with_contexts)
+
+ subject
+ end
+ end
+ end
end
context 'when path is invalid' do