Commit 5c2592da authored by Rubén Dávila's avatar Rubén Dávila

Check ci_cd_only param explicitly for 'true' value

That way it will not create a CI/CD project when the FE pass a `false`
value with it.

Also fixed some broken specs
parent 7ebc8e80
......@@ -11,8 +11,9 @@ module EE
override :extra_import_params
def extra_import_params
extra_params = super
extra_params[:ci_cd_only] = true if params[:ci_cd_only].present?
ci_cd_only = Gitlab::Utils.to_boolean(params[:ci_cd_only])
extra_params[:ci_cd_only] = true if ci_cd_only
extra_params
end
end
......
......@@ -9,7 +9,7 @@ module EE
mirror = params.delete(:mirror)
mirror_user_id = params.delete(:mirror_user_id)
mirror_trigger_builds = params.delete(:mirror_trigger_builds)
ci_cd_only = params.delete(:ci_cd_only)
ci_cd_only = Gitlab::Utils.to_boolean(params.delete(:ci_cd_only))
project = super do |project|
# Repository size limit comes as MB from the view
......
......@@ -63,6 +63,24 @@ feature 'New project' do
expect(page).to have_css('#ci-cd-project-pane')
end
it '"Import project" tab creates projects with features enabled' do
visit new_project_path
find('#import-project-tab').click
page.within '#import-project-pane' do
first('.js-import-git-toggle-button').click
fill_in 'project_import_url', with: 'http://foo.git'
fill_in 'project_path', with: 'import-project-with-features1'
choose 'project_visibility_level_20'
click_button 'Create project'
created_project = Project.last
expect(current_path).to eq(project_path(created_project))
expect(created_project.project_feature).to be_issues_enabled
end
end
it 'creates CI/CD project from repo URL' do
visit new_project_path
find('#ci-cd-project-tab').click
......
......@@ -112,7 +112,7 @@ describe Project do
project.ensure_external_webhook_token
expect(project.external_webhook_token).to be_present
end
end
end
describe 'hard failing a mirror' do
it 'sends a notification' do
......
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