Commit a12617bd authored by Lin Jen-Shin's avatar Lin Jen-Shin

Add target_project arg to Group#to_reference

This will be the same as User#to_reference
parent 253591a3
...@@ -169,7 +169,7 @@ class Group < Namespace ...@@ -169,7 +169,7 @@ class Group < Namespace
notification_settings.find { |n| n.notification_email.present? }&.notification_email notification_settings.find { |n| n.notification_email.present? }&.notification_email
end end
def to_reference(_from = nil, full: nil) def to_reference(_from = nil, target_project: nil, full: nil)
"#{self.class.reference_prefix}#{full_path}" "#{self.class.reference_prefix}#{full_path}"
end end
......
---
title: Fix moving an issue when there is a group reference
merge_request: 30185
author:
type: fixed
...@@ -147,6 +147,18 @@ describe Gitlab::Gfm::ReferenceRewriter do ...@@ -147,6 +147,18 @@ describe Gitlab::Gfm::ReferenceRewriter do
it { is_expected.to eq text } it { is_expected.to eq text }
end end
context 'when referring to a group' do
let(:text) { "group @#{group.full_path}" }
it { is_expected.to eq text }
end
context 'when referring to a user' do
let(:text) { "user @#{user.full_path}" }
it { is_expected.to eq text }
end
context 'when referable has a nil reference' do context 'when referable has a nil reference' do
before do before do
create(:milestone, title: '9.0', project: old_project) create(:milestone, title: '9.0', project: old_project)
......
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