From cfaf012c532a269a230f67b31e623b18e3f8f8b1 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Mon, 3 Jun 2019 15:04:59 -0700 Subject: Fix project settings not being able to update Previously import_url would always be present in the update parameters, which would cause the validation to fail. We now only include this parameter only if there is URL given. Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/62708 --- spec/controllers/concerns/import_url_params_spec.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'spec/controllers/concerns') diff --git a/spec/controllers/concerns/import_url_params_spec.rb b/spec/controllers/concerns/import_url_params_spec.rb index fc5dfb5263f..adbe6e5d3bf 100644 --- a/spec/controllers/concerns/import_url_params_spec.rb +++ b/spec/controllers/concerns/import_url_params_spec.rb @@ -8,6 +8,18 @@ describe ImportUrlParams do controller.import_url_params end + context 'empty URL' do + let(:params) do + ActionController::Parameters.new(project: { + title: 'Test' + }) + end + + it 'returns empty hash' do + expect(import_url_params).to eq({}) + end + end + context 'url and password separately provided' do let(:params) do ActionController::Parameters.new(project: { -- cgit v1.2.3