diff options
Diffstat (limited to 'spec/controllers/projects/pipelines_controller_spec.rb')
-rw-r--r-- | spec/controllers/projects/pipelines_controller_spec.rb | 45 |
1 files changed, 14 insertions, 31 deletions
diff --git a/spec/controllers/projects/pipelines_controller_spec.rb b/spec/controllers/projects/pipelines_controller_spec.rb index 0e6b5e84d85..a80c5fa82f6 100644 --- a/spec/controllers/projects/pipelines_controller_spec.rb +++ b/spec/controllers/projects/pipelines_controller_spec.rb @@ -274,30 +274,26 @@ RSpec.describe Projects::PipelinesController do end describe 'GET #index' do - context 'pipeline_empty_state_templates experiment' do - before do - stub_application_setting(auto_devops_enabled: false) - end + before do + stub_application_setting(auto_devops_enabled: false) + end - it 'tracks the view', :experiment do - expect(experiment(:pipeline_empty_state_templates)) - .to track(:view, value: project.namespace_id) - .with_context(actor: user) - .on_next_instance + def action + get :index, params: { namespace_id: project.namespace, project_id: project } + end - get :index, params: { namespace_id: project.namespace, project_id: project } - end + subject { project.namespace } + + context 'pipeline_empty_state_templates experiment' do + it_behaves_like 'tracks assignment and records the subject', :pipeline_empty_state_templates, :namespace end context 'code_quality_walkthrough experiment' do - it 'tracks the view', :experiment do - expect(experiment(:code_quality_walkthrough)) - .to track(:view, property: project.root_ancestor.id.to_s) - .with_context(namespace: project.root_ancestor) - .on_next_instance + it_behaves_like 'tracks assignment and records the subject', :code_quality_walkthrough, :namespace + end - get :index, params: { namespace_id: project.namespace, project_id: project } - end + context 'ci_runner_templates experiment' do + it_behaves_like 'tracks assignment and records the subject', :ci_runner_templates, :namespace end end @@ -878,19 +874,6 @@ RSpec.describe Projects::PipelinesController do expect(::Ci::RetryPipelineWorker).to have_received(:perform_async).with(pipeline.id, user.id) end - context 'when feature flag is disabled' do - before do - stub_feature_flags(background_pipeline_retry_endpoint: false) - end - - it 'retries the pipeline without returning any content' do - post_retry - - expect(response).to have_gitlab_http_status(:no_content) - expect(build.reload).to be_retried - end - end - context 'when builds are disabled' do let(:feature) { ProjectFeature::DISABLED } |