diff options
Diffstat (limited to 'spec/requests/api/ci/pipeline_schedules_spec.rb')
-rw-r--r-- | spec/requests/api/ci/pipeline_schedules_spec.rb | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/spec/requests/api/ci/pipeline_schedules_spec.rb b/spec/requests/api/ci/pipeline_schedules_spec.rb index d760e4ddf28..d5f60e62b06 100644 --- a/spec/requests/api/ci/pipeline_schedules_spec.rb +++ b/spec/requests/api/ci/pipeline_schedules_spec.rb @@ -311,7 +311,8 @@ RSpec.describe API::Ci::PipelineSchedules, feature_category: :continuous_integra end end - describe 'POST /projects/:id/pipeline_schedules' do + # Move this from `shared_context` to `describe` when `ci_refactoring_pipeline_schedule_create_service` is removed. + shared_context 'POST /projects/:id/pipeline_schedules' do # rubocop:disable RSpec/ContextWording let(:params) { attributes_for(:ci_pipeline_schedule) } context 'authenticated user with valid permissions' do @@ -368,7 +369,8 @@ RSpec.describe API::Ci::PipelineSchedules, feature_category: :continuous_integra end end - describe 'PUT /projects/:id/pipeline_schedules/:pipeline_schedule_id' do + # Move this from `shared_context` to `describe` when `ci_refactoring_pipeline_schedule_create_service` is removed. + shared_context 'PUT /projects/:id/pipeline_schedules/:pipeline_schedule_id' do let(:pipeline_schedule) do create(:ci_pipeline_schedule, project: project, owner: developer) end @@ -437,6 +439,18 @@ RSpec.describe API::Ci::PipelineSchedules, feature_category: :continuous_integra end end + it_behaves_like 'POST /projects/:id/pipeline_schedules' + it_behaves_like 'PUT /projects/:id/pipeline_schedules/:pipeline_schedule_id' + + context 'when the FF ci_refactoring_pipeline_schedule_create_service is disabled' do + before do + stub_feature_flags(ci_refactoring_pipeline_schedule_create_service: false) + end + + it_behaves_like 'POST /projects/:id/pipeline_schedules' + it_behaves_like 'PUT /projects/:id/pipeline_schedules/:pipeline_schedule_id' + end + describe 'POST /projects/:id/pipeline_schedules/:pipeline_schedule_id/take_ownership' do let(:pipeline_schedule) do create(:ci_pipeline_schedule, project: project, owner: developer) |