Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2017-06-28 15:28:29 +0300
committerShinya Maeda <shinya@gitlab.com>2017-07-05 12:38:27 +0300
commitf433fee0571136d0d84e6bba11f9ae0e046c8bd0 (patch)
tree48420a45fb9dbd2582ab3a8f19598b0529a34594 /spec/controllers/projects/pipeline_schedules_controller_spec.rb
parent6c5c525a2a08e8063a1ce5705160fcf2976fd1e6 (diff)
Revert extra validation for duplication between same keys on a submit
Diffstat (limited to 'spec/controllers/projects/pipeline_schedules_controller_spec.rb')
-rw-r--r--spec/controllers/projects/pipeline_schedules_controller_spec.rb60
1 files changed, 31 insertions, 29 deletions
diff --git a/spec/controllers/projects/pipeline_schedules_controller_spec.rb b/spec/controllers/projects/pipeline_schedules_controller_spec.rb
index 5f6b3c0a187..1567bde2a62 100644
--- a/spec/controllers/projects/pipeline_schedules_controller_spec.rb
+++ b/spec/controllers/projects/pipeline_schedules_controller_spec.rb
@@ -142,21 +142,22 @@ describe Projects::PipelineSchedulesController do
end
end
- context 'when variables_attributes has two variables and duplicted' do
- let(:schedule) do
- basic_param.merge({
- variables_attributes: [ { key: 'AAA', value: 'AAA123' }, { key: 'AAA', value: 'BBB123' } ]
- })
- end
-
- it 'returns an error that the keys of variable are duplicated' do
- expect { post :create, namespace_id: project.namespace.to_param, project_id: project, schedule: schedule }
- .to change { Ci::PipelineSchedule.count }.by(0)
- .and change { Ci::PipelineScheduleVariable.count }.by(0)
-
- expect(assigns(:schedule).errors['variables.key']).not_to be_empty
- end
- end
+ # This test no longer passes, since we removed a custom validation
+ # context 'when variables_attributes has two variables and duplicted' do
+ # let(:schedule) do
+ # basic_param.merge({
+ # variables_attributes: [ { key: 'AAA', value: 'AAA123' }, { key: 'AAA', value: 'BBB123' } ]
+ # })
+ # end
+
+ # it 'returns an error that the keys of variable are duplicated' do
+ # expect { post :create, namespace_id: project.namespace.to_param, project_id: project, schedule: schedule }
+ # .to change { Ci::PipelineSchedule.count }.by(0)
+ # .and change { Ci::PipelineScheduleVariable.count }.by(0)
+
+ # expect(assigns(:schedule).errors['variables.key']).not_to be_empty
+ # end
+ # end
end
describe 'security' do
@@ -260,20 +261,21 @@ describe Projects::PipelineSchedulesController do
end
end
- context 'when params include two duplicated variables' do
- let(:schedule) do
- basic_param.merge({
- variables_attributes: [ { key: 'AAA', value: 'AAA123' }, { key: 'AAA', value: 'BBB123' } ]
- })
- end
-
- it 'returns an error that variables are duplciated' do
- put :update, namespace_id: project.namespace.to_param,
- project_id: project, id: pipeline_schedule, schedule: schedule
-
- expect(assigns(:schedule).errors['variables.key']).not_to be_empty
- end
- end
+ # This test no longer passes, since we removed a custom validation
+ # context 'when params include two duplicated variables' do
+ # let(:schedule) do
+ # basic_param.merge({
+ # variables_attributes: [ { key: 'AAA', value: 'AAA123' }, { key: 'AAA', value: 'BBB123' } ]
+ # })
+ # end
+
+ # it 'returns an error that variables are duplciated' do
+ # put :update, namespace_id: project.namespace.to_param,
+ # project_id: project, id: pipeline_schedule, schedule: schedule
+
+ # expect(assigns(:schedule).errors['variables.key']).not_to be_empty
+ # end
+ # end
end
context 'when a pipeline schedule has one variable' do