Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2016-12-21 19:41:33 +0300
committerJames Lopez <james@jameslopez.es>2017-01-03 15:01:46 +0300
commit112f47057275312daa876bee5bd74d5464410bc5 (patch)
tree257495d658a39b8e31c3407498ec248cb97976a6 /spec/models/issue_spec.rb
parentde25604fbca2f7005754d821d571bbcb1cc510ac (diff)
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.
Diffstat (limited to 'spec/models/issue_spec.rb')
-rw-r--r--spec/models/issue_spec.rb4
1 files changed, 4 insertions, 0 deletions
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"