diff options
author | Rémy Coutable <remy@rymai.me> | 2018-05-25 20:27:31 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2018-05-25 20:27:31 +0300 |
commit | 6f4935bcee76a7af532399945f440a8fbd15658e (patch) | |
tree | 44baceef898f2bd824e28e4e7fbed1ec30b93479 | |
parent | f0f63b79f4791294603550921b68bf070fc84aff (diff) | |
parent | 2dd1c8e5d84163e3cfc655e0dad5384f1d4aa0c2 (diff) |
Merge branch '46740-projectmilestones-setting-start_date-via-the-api-requires-a-second-parameter' into 'master'
Resolve "ProjectMilestones: Setting start_date via the API requires a second parameter"
Closes #46740
See merge request gitlab-org/gitlab-ce!19133
-rw-r--r-- | lib/api/milestone_responses.rb | 2 | ||||
-rw-r--r-- | spec/support/api/milestones_shared_examples.rb | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/lib/api/milestone_responses.rb b/lib/api/milestone_responses.rb index c570eace862..a8eb137e46a 100644 --- a/lib/api/milestone_responses.rb +++ b/lib/api/milestone_responses.rb @@ -24,7 +24,7 @@ module API optional :state_event, type: String, values: %w[close activate], desc: 'The state event of the milestone ' use :optional_params - at_least_one_of :title, :description, :due_date, :state_event + at_least_one_of :title, :description, :start_date, :due_date, :state_event end def list_milestones_for(parent) diff --git a/spec/support/api/milestones_shared_examples.rb b/spec/support/api/milestones_shared_examples.rb index 0388f110d71..a15189db35f 100644 --- a/spec/support/api/milestones_shared_examples.rb +++ b/spec/support/api/milestones_shared_examples.rb @@ -196,6 +196,12 @@ shared_examples_for 'group and project milestones' do |route_definition| expect(json_response['state']).to eq('closed') end + + it 'updates milestone with only start date' do + put api(resource_route, user), start_date: Date.tomorrow + + expect(response).to have_gitlab_http_status(200) + end end describe "GET #{route_definition}/:milestone_id/issues" do |