diff options
author | Gabriel Gizotti <gabriel@gizotti.com> | 2016-12-13 23:00:00 +1000 |
---|---|---|
committer | Gabriel Gizotti <gabriel@gizotti.com> | 2016-12-16 19:15:07 +1000 |
commit | 3e3d6b53dcdc50bbe45c4b3ff43faf3d2728f72c (patch) | |
tree | 2779e96846290041ee69ce91edc1bd2c9ef32d82 | |
parent | f3378630c15d43080d2bda03f5165653092a660b (diff) | |
download | gitlab-ce-3e3d6b53dcdc50bbe45c4b3ff43faf3d2728f72c.tar.gz |
Change closes issues reference text on MergeRequest#merge_commit_message to match existing text generated by the system
-rw-r--r-- | app/models/merge_request.rb | 3 | ||||
-rw-r--r-- | spec/features/merge_requests/merge_commit_message_toggle_spec.rb | 2 | ||||
-rw-r--r-- | spec/models/merge_request_spec.rb | 6 |
3 files changed, 5 insertions, 6 deletions
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb index acaf14a12e9..b7c775777c7 100644 --- a/app/models/merge_request.rb +++ b/app/models/merge_request.rb @@ -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? diff --git a/spec/features/merge_requests/merge_commit_message_toggle_spec.rb b/spec/features/merge_requests/merge_commit_message_toggle_spec.rb index 2c78234bd0f..3dbe26cddb0 100644 --- a/spec/features/merge_requests/merge_commit_message_toggle_spec.rb +++ b/spec/features/merge_requests/merge_commit_message_toggle_spec.rb @@ -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 diff --git a/spec/models/merge_request_spec.rb b/spec/models/merge_request_spec.rb index 1e9790cf644..5da00a8636a 100644 --- a/spec/models/merge_request_spec.rb +++ b/spec/models/merge_request_spec.rb @@ -416,16 +416,16 @@ describe MergeRequest, models: true do end it 'includes its closed issues in the body' do - issue = create(:issue, project: subject.project) + 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 |