summaryrefslogtreecommitdiff
path: root/spec/models/milestone_spec.rb
diff options
context:
space:
mode:
authorOswaldo Ferreira <oswluizf@gmail.com>2016-11-02 21:49:13 -0200
committerOswaldo Ferreira <oswluizf@gmail.com>2016-12-02 19:18:17 -0200
commitf272ee6eba37548cbd8919139d583a71ffdac8dc (patch)
tree78d1e9a5e7bcf4935e8efbe4e5e6e4b976dfc9e8 /spec/models/milestone_spec.rb
parent3ebb815a38ba86e4133557f77b94c292c8fc2e7e (diff)
downloadgitlab-ce-f272ee6eba37548cbd8919139d583a71ffdac8dc.tar.gz
Add shorthand support to gitlab markdown references
Diffstat (limited to 'spec/models/milestone_spec.rb')
-rw-r--r--spec/models/milestone_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/models/milestone_spec.rb b/spec/models/milestone_spec.rb
index a4bfe851dfb..0cc2efae5f9 100644
--- a/spec/models/milestone_spec.rb
+++ b/spec/models/milestone_spec.rb
@@ -246,4 +246,18 @@ describe Milestone, models: true do
end
end
end
+
+ describe '#to_reference' do
+ let(:project) { build(:empty_project, name: 'sample-project') }
+ let(:milestone) { build(:milestone, iid: 1, project: project) }
+
+ it 'returns a String reference to the object' do
+ expect(milestone.to_reference).to eq "%1"
+ end
+
+ it 'supports a cross-project reference' do
+ another_project = build(:project, name: 'another-project', namespace: project.namespace)
+ expect(milestone.to_reference(another_project)).to eq "sample-project%1"
+ end
+ end
end