Commit 3e3d6b53 authored by Gabriel Gizotti's avatar Gabriel Gizotti

Change closes issues reference text on MergeRequest#merge_commit_message to...

Change closes issues reference text on MergeRequest#merge_commit_message to match existing text generated by the system
parent f3378630
......@@ -636,8 +636,7 @@ class MergeRequest < ActiveRecord::Base
]
if !include_description && closes_issues_references.present?
issue_text = 'issue'.pluralize(closes_issues_references.size)
message << "Closes #{issue_text} #{closes_issues_references.to_sentence}"
message << "Closes #{closes_issues_references.to_sentence}"
end
message << "#{description}" if include_description && description.present?
......
......@@ -20,7 +20,7 @@ feature 'Clicking toggle commit message link', feature: true, js: true do
[
"Merge branch 'feature' into 'master'",
merge_request.title,
"Closes issues #{issue_1.to_reference} and #{issue_2.to_reference}",
"Closes #{issue_1.to_reference} and #{issue_2.to_reference}",
"See merge request #{merge_request.to_reference}"
].join("\n\n")
end
......
......@@ -419,13 +419,13 @@ describe MergeRequest, models: true do
issue = create(:issue, project: subject.project)
subject.project.team << [subject.author, :developer]
subject.description = "Closes #{issue.to_reference}"
subject.description = "This issue Closes #{issue.to_reference}"
allow(subject.project).to receive(:default_branch).
and_return(subject.target_branch)
expect(subject.merge_commit_message)
.to match("Closes issue #{issue.to_reference}")
.to match("Closes #{issue.to_reference}")
end
it 'includes its reference in the body' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment