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

This commit is contained in:
Shinya Maeda 2017-05-27 22:31:22 +09:00
parent 63ca126e97
commit 3b61451c46
2 changed files with 3 additions and 7 deletions

View File

@ -114,20 +114,16 @@ module API
not_found!('PipelineSchedule') unless pipeline_schedule
status :accepted
present pipeline_schedule.destroy, with: Entities::PipelineScheduleDetails
end
end
helpers do
def pipeline_schedules
@pipeline_schedules ||=
user_project.pipeline_schedules.preload([:owner, :last_pipeline])
end
def pipeline_schedule
@pipeline_schedule ||=
user_project.pipeline_schedules
.preload([:owner, :last_pipeline])
.preload(:owner, :last_pipeline)
.find_by(id: params.delete(:pipeline_schedule_id))
end
end

View File

@ -267,7 +267,7 @@ describe API::PipelineSchedules do
delete api("/projects/#{project.id}/pipeline_schedules/#{pipeline_schedule.id}", master)
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')
end