Commit 1fdd4a7a authored by Dmytro Zaporozhets (DZ)'s avatar Dmytro Zaporozhets (DZ)

Merge branch '244876-fix-duplicate-closes-text' into 'master'

Remove duplicate reference to issue

See merge request gitlab-org/gitlab!41372
parents 6f9a2927 34a92b48
......@@ -16,8 +16,6 @@ module EE
merge_request.description.blank?
merge_request.description = target_project.merge_requests_template
append_closes_description
end
end
end
......
......@@ -66,6 +66,31 @@ RSpec.describe MergeRequests::BuildService do
expect(merge_request.description).to eq(description)
end
end
context 'when MR is set to close an issue' do
let(:issue) { create(:issue, project: project) }
let(:service) do
described_class.new(
project,
user,
description: description,
source_branch: source_branch,
target_branch: target_branch,
source_project: source_project,
target_project: target_project,
issue_iid: issue.iid
)
end
before do
project.add_guest(user)
end
it 'appends closing reference once' do
expect(merge_request.description).to eq(template + "\n\nCloses ##{issue.iid}")
end
end
end
end
end
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