Commit ad2cc996 authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre

Merge branch '215326-moving-an-issue-referencing-a-group-in-a-note-can-fail' into 'master'

Resolve "Moving an issue referencing a group in a note can fail"

Closes #215326

See merge request gitlab-org/gitlab!30185
parents a1d21233 a12617bd
......@@ -170,7 +170,7 @@ class Group < Namespace
notification_settings.find { |n| n.notification_email.present? }&.notification_email
end
def to_reference(_from = nil, full: nil)
def to_reference(_from = nil, target_project: nil, full: nil)
"#{self.class.reference_prefix}#{full_path}"
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
it { is_expected.to eq text }
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
before do
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