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/services/projects/create_service_spec.rb')
-rw-r--r--spec/services/projects/create_service_spec.rb14
1 files changed, 11 insertions, 3 deletions
diff --git a/spec/services/projects/create_service_spec.rb b/spec/services/projects/create_service_spec.rb
index 306d87eefb8..e0d6b9afcff 100644
--- a/spec/services/projects/create_service_spec.rb
+++ b/spec/services/projects/create_service_spec.rb
@@ -673,7 +673,17 @@ RSpec.describe Projects::CreateService, '#execute' do
expect(rugged.config['gitlab.fullpath']).to eq project.full_path
end
+ it 'triggers PostCreationWorker' do
+ expect(Projects::PostCreationWorker).to receive(:perform_async).with(a_kind_of(Integer))
+
+ create_project(user, opts)
+ end
+
context 'when project has access to shared service' do
+ before do
+ stub_feature_flags(projects_post_creation_worker: false)
+ end
+
context 'Prometheus application is shared via group cluster' do
let(:cluster) { create(:cluster, :group, groups: [group]) }
let(:group) do
@@ -714,9 +724,7 @@ RSpec.describe Projects::CreateService, '#execute' do
it 'cleans invalid record and logs warning', :aggregate_failures do
invalid_service_record = build(:prometheus_service, properties: { api_url: nil, manual_configuration: true }.to_json)
- allow_next_instance_of(Project) do |instance|
- allow(instance).to receive(:build_prometheus_service).and_return(invalid_service_record)
- end
+ allow(PrometheusService).to receive(:new).and_return(invalid_service_record)
expect(Gitlab::ErrorTracking).to receive(:track_exception).with(an_instance_of(ActiveRecord::RecordInvalid), include(extra: { project_id: a_kind_of(Integer) }))
project = create_project(user, opts)