diff options
author | Stan Hu <stanhu@gmail.com> | 2016-08-30 14:48:17 -0700 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2016-08-30 14:48:17 -0700 |
commit | 341541d3afa2f589906da077d8a90e549ed0577e (patch) | |
tree | 17472b5359e4d864e54ad7c59a734ea70a222fdf /spec/controllers | |
parent | 0051f58f078e7cf3e9e0a418de89a87999d5cdf2 (diff) | |
parent | 7dd97cff3448b6b5d081829e782823113c2db91f (diff) | |
download | gitlab-ce-341541d3afa2f589906da077d8a90e549ed0577e.tar.gz |
Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce
Diffstat (limited to 'spec/controllers')
-rw-r--r-- | spec/controllers/projects/merge_requests_controller_spec.rb | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/spec/controllers/projects/merge_requests_controller_spec.rb b/spec/controllers/projects/merge_requests_controller_spec.rb index c64c2b075c5..a219400d75f 100644 --- a/spec/controllers/projects/merge_requests_controller_spec.rb +++ b/spec/controllers/projects/merge_requests_controller_spec.rb @@ -170,6 +170,35 @@ describe Projects::MergeRequestsController do expect(response).to redirect_to([merge_request.target_project.namespace.becomes(Namespace), merge_request.target_project, merge_request]) expect(merge_request.reload.closed?).to be_truthy end + + it 'allows editing of a closed merge request' do + merge_request.close! + + put :update, + namespace_id: project.namespace.path, + project_id: project.path, + id: merge_request.iid, + merge_request: { + title: 'New title' + } + + expect(response).to redirect_to([merge_request.target_project.namespace.becomes(Namespace), merge_request.target_project, merge_request]) + expect(merge_request.reload.title).to eq 'New title' + end + + it 'does not allow to update target branch closed merge request' do + merge_request.close! + + put :update, + namespace_id: project.namespace.path, + project_id: project.path, + id: merge_request.iid, + merge_request: { + target_branch: 'new_branch' + } + + expect { merge_request.reload.target_branch }.not_to change { merge_request.target_branch } + end end end |