Add number sign on external issue reference text
This commit is contained in:
parent
fc6ee35928
commit
b372968e93
|
@ -34,7 +34,15 @@ class ExternalIssue
|
|||
%r{(?<issue>\b([A-Z][A-Z0-9_]+-)\d+)}
|
||||
end
|
||||
|
||||
def self.reference_prefix
|
||||
'#'
|
||||
end
|
||||
|
||||
def to_reference(_from_project = nil)
|
||||
id
|
||||
end
|
||||
|
||||
def reference_link_text(from_project = nil)
|
||||
"#{self.class.reference_prefix}#{id}"
|
||||
end
|
||||
end
|
||||
|
|
|
@ -36,4 +36,10 @@ describe ExternalIssue, models: true do
|
|||
expect(issue.title).to eq "External Issue #{issue}"
|
||||
end
|
||||
end
|
||||
|
||||
describe '#reference_link_text' do
|
||||
it 'returns a String reference to the object' do
|
||||
expect(issue.reference_link_text).to eq '#EXT-1234'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue