Commit 3b61451c authored by Shinya Maeda's avatar Shinya Maeda

Return 202 for destory. Remove []. Remove def pipeline_schedules from helper.

parent 63ca126e
...@@ -114,20 +114,16 @@ module API ...@@ -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 ...@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment