From 112f47057275312daa876bee5bd74d5464410bc5 Mon Sep 17 00:00:00 2001 From: James Lopez Date: Wed, 21 Dec 2016 17:41:33 +0100 Subject: Fix cross-project references copy to include the project reference Also added relevant specs and refactored to_references in a bunch of places to be more consistent. --- spec/models/issue_spec.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'spec/models/issue_spec.rb') diff --git a/spec/models/issue_spec.rb b/spec/models/issue_spec.rb index bb56e44db29..bfa36d92ac3 100644 --- a/spec/models/issue_spec.rb +++ b/spec/models/issue_spec.rb @@ -30,6 +30,10 @@ describe Issue, models: true do expect(issue.to_reference).to eq "#1" end + it 'returns a String reference with the full path' do + expect(issue.to_reference(full: true)).to eq(project.path_with_namespace + '#1') + end + it 'supports a cross-project reference' do another_project = build(:project, name: 'another-project', namespace: project.namespace) expect(issue.to_reference(another_project)).to eq "sample-project#1" -- cgit v1.2.1