diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2018-08-28 07:49:09 +0000 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2018-08-28 07:49:09 +0000 |
commit | 722631a9290e07cc0d83baf7bf332223ab7cf8b6 (patch) | |
tree | 3e1b00852e04cb76236a985e57a3afa6d37ebc68 /spec/support/api | |
parent | 881ba3f5977dafda7feee77f841ace290c918a8d (diff) | |
parent | abb50ff4710e264c0c700df88757ee3ab1cf7dfb (diff) | |
download | gitlab-ce-722631a9290e07cc0d83baf7bf332223ab7cf8b6.tar.gz |
Merge branch 'issue_36138' into 'master'
Allow to delete group milestones
Closes #36138
See merge request gitlab-org/gitlab-ce!21057
Diffstat (limited to 'spec/support/api')
-rw-r--r-- | spec/support/api/milestones_shared_examples.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/support/api/milestones_shared_examples.rb b/spec/support/api/milestones_shared_examples.rb index afd6448aa26..3bebb7aae90 100644 --- a/spec/support/api/milestones_shared_examples.rb +++ b/spec/support/api/milestones_shared_examples.rb @@ -196,6 +196,24 @@ shared_examples_for 'group and project milestones' do |route_definition| end end + describe "DELETE #{route_definition}/:milestone_id" do + it "rejects a member with reporter access from deleting a milestone" do + reporter = create(:user) + milestone.parent.add_reporter(reporter) + + delete api(resource_route, reporter) + + expect(response).to have_gitlab_http_status(403) + end + + it 'deletes the milestone when the user has developer access to the project' do + delete api(resource_route, user) + + expect(project.milestones.find_by_id(milestone.id)).to be_nil + expect(response).to have_gitlab_http_status(204) + end + end + describe "GET #{route_definition}/:milestone_id/issues" do let(:issues_route) { "#{route}/#{milestone.id}/issues" } |