Return 202 for destory. Remove []. Remove def pipeline_schedules from helper.
This commit is contained in:
parent
63ca126e97
commit
3b61451c46
|
@ -114,20 +114,16 @@ module API
|
||||||
|
|
||||||
not_found!('PipelineSchedule') unless pipeline_schedule
|
not_found!('PipelineSchedule') unless pipeline_schedule
|
||||||
|
|
||||||
|
status :accepted
|
||||||
present pipeline_schedule.destroy, with: Entities::PipelineScheduleDetails
|
present pipeline_schedule.destroy, with: Entities::PipelineScheduleDetails
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
helpers do
|
helpers do
|
||||||
def pipeline_schedules
|
|
||||||
@pipeline_schedules ||=
|
|
||||||
user_project.pipeline_schedules.preload([:owner, :last_pipeline])
|
|
||||||
end
|
|
||||||
|
|
||||||
def pipeline_schedule
|
def pipeline_schedule
|
||||||
@pipeline_schedule ||=
|
@pipeline_schedule ||=
|
||||||
user_project.pipeline_schedules
|
user_project.pipeline_schedules
|
||||||
.preload([:owner, :last_pipeline])
|
.preload(:owner, :last_pipeline)
|
||||||
.find_by(id: params.delete(:pipeline_schedule_id))
|
.find_by(id: params.delete(:pipeline_schedule_id))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -267,7 +267,7 @@ describe API::PipelineSchedules do
|
||||||
delete api("/projects/#{project.id}/pipeline_schedules/#{pipeline_schedule.id}", master)
|
delete api("/projects/#{project.id}/pipeline_schedules/#{pipeline_schedule.id}", master)
|
||||||
end.to change { project.pipeline_schedules.count }.by(-1)
|
end.to change { project.pipeline_schedules.count }.by(-1)
|
||||||
|
|
||||||
expect(response).to have_http_status(:ok)
|
expect(response).to have_http_status(:accepted)
|
||||||
expect(response).to match_response_schema('pipeline_schedule')
|
expect(response).to match_response_schema('pipeline_schedule')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue