summaryrefslogtreecommitdiff
path: root/spec/views
diff options
context:
space:
mode:
authorKatarzyna Kobierska <kkobierska@gmail.com>2016-09-22 15:49:53 +0200
committerKatarzyna Kobierska <kkobierska@gmail.com>2016-09-30 11:28:05 +0200
commit25edb0709ccfae340817dc2f414cc8207899a2e0 (patch)
treedb1097057d8c2e5751158aff5b4af369e04dd260 /spec/views
parentdde96231833e9b4673cd04686953205b2105416d (diff)
downloadgitlab-ce-25edb0709ccfae340817dc2f414cc8207899a2e0.tar.gz
Close merge request if open without source project
Diffstat (limited to 'spec/views')
-rw-r--r--spec/views/projects/merge_requests/show.html.haml_spec.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/views/projects/merge_requests/show.html.haml_spec.rb b/spec/views/projects/merge_requests/show.html.haml_spec.rb
index 68fbb4585c1..842b53344c1 100644
--- a/spec/views/projects/merge_requests/show.html.haml_spec.rb
+++ b/spec/views/projects/merge_requests/show.html.haml_spec.rb
@@ -41,4 +41,17 @@ describe 'projects/merge_requests/show.html.haml' do
expect(rendered).to have_css('a', visible: false, text: 'Close')
end
end
+
+ context 'when the merge request is open' do
+ it 'closes open merge request' do
+ closed_merge_request.update_attributes(state: 'open')
+ fork_project.destroy
+
+ render
+
+ expect(closed_merge_request.reload.state).to eq('closed')
+ expect(rendered).to have_css('a', visible: false, text: 'Reopen')
+ expect(rendered).to have_css('a', visible: false, text: 'Close')
+ end
+ end
end