Merge branch '54656-500-error-on-save-of-general-pipeline-settings-timeout' into 'master'

Resolve "500 error on save of general pipeline settings timeout"

Closes gitlab-ee#11281

See merge request gitlab-org/gitlab-ce!27416
This commit is contained in:
Stan Hu 2019-04-24 15:50:45 +00:00
commit 23e5d9edce
3 changed files with 15 additions and 1 deletions

View file

@ -19,7 +19,7 @@ module Projects
redirect_to project_settings_ci_cd_path(@project)
else
render 'show'
redirect_to project_settings_ci_cd_path(@project), alert: result[:message]
end
end
end

View file

@ -0,0 +1,5 @@
---
title: Fix 500 in general pipeline settings when passing an invalid build timeout.
merge_request: 27416
author:
type: fixed

View file

@ -191,6 +191,15 @@ describe Projects::Settings::CiCdController do
expect(project.build_timeout).to eq(5400)
end
end
context 'when build_timeout_human_readable is invalid' do
let(:params) { { build_timeout_human_readable: '5m' } }
it 'set specified timeout' do
expect(subject).to set_flash[:alert]
expect(response).to redirect_to(namespace_project_settings_ci_cd_path)
end
end
end
end
end