summaryrefslogtreecommitdiff
path: root/spec/models/merge_request_spec.rb
diff options
context:
space:
mode:
authorJacob Vosmaer <contact@jacobvosmaer.nl>2014-06-13 16:19:08 +0200
committerJacob Vosmaer <contact@jacobvosmaer.nl>2014-06-13 17:25:44 +0200
commit3f1ece26909f90e538a50cd724b64da28f0b7308 (patch)
tree1f10f7efef48602ef910d71b0f3411d34654e57a /spec/models/merge_request_spec.rb
parent5fdcaadf347e41109f20a4dee733f5b51030feda (diff)
downloadgitlab-ce-3f1ece26909f90e538a50cd724b64da28f0b7308.tar.gz
Detect closing issues in Merge Request description
Diffstat (limited to 'spec/models/merge_request_spec.rb')
-rw-r--r--spec/models/merge_request_spec.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/models/merge_request_spec.rb b/spec/models/merge_request_spec.rb
index 81a48699cd8..1148df87ab7 100644
--- a/spec/models/merge_request_spec.rb
+++ b/spec/models/merge_request_spec.rb
@@ -105,6 +105,14 @@ describe MergeRequest do
subject.closes_issues.should be_empty
end
+
+ it 'detects issues mentioned in the description' do
+ issue2 = create(:issue, project: subject.project)
+ subject.description = "Closes ##{issue2.iid}"
+ subject.project.stub(default_branch: subject.target_branch)
+
+ subject.closes_issues.should include(issue2)
+ end
end
it_behaves_like 'an editable mentionable' do