Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
ca268b85
Commit
ca268b85
authored
May 02, 2015
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use to_reference in Markdown feature spec
parent
3b80cf52
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
43 deletions
+38
-43
spec/features/markdown_spec.rb
spec/features/markdown_spec.rb
+6
-11
spec/fixtures/markdown.md.erb
spec/fixtures/markdown.md.erb
+32
-32
No files found.
spec/features/markdown_spec.rb
View file @
ca268b85
...
...
@@ -344,13 +344,13 @@ class MarkdownFeature
end
def
commit
@commit
||=
project
.
repository
.
commit
@commit
||=
project
.
commit
end
def
commit_range
unless
@commit_range
commit2
=
project
.
repository
.
commit
(
'HEAD~3'
)
@commit_range
=
CommitRange
.
new
(
"
#{
commit
.
id
}
...
#{
commit2
.
id
}
"
)
commit2
=
project
.
commit
(
'HEAD~3'
)
@commit_range
=
CommitRange
.
new
(
"
#{
commit
.
id
}
...
#{
commit2
.
id
}
"
,
project
)
end
@commit_range
...
...
@@ -376,11 +376,6 @@ class MarkdownFeature
@xproject
end
# Shortcut to "cross-reference/project"
def
xref
xproject
.
path_with_namespace
end
def
xissue
@xissue
||=
create
(
:issue
,
project:
xproject
)
end
...
...
@@ -394,13 +389,13 @@ class MarkdownFeature
end
def
xcommit
@xcommit
||=
xproject
.
repository
.
commit
@xcommit
||=
xproject
.
commit
end
def
xcommit_range
unless
@xcommit_range
xcommit2
=
xproject
.
repository
.
commit
(
'HEAD~2'
)
@xcommit_range
=
CommitRange
.
new
(
"
#{
xcommit
.
id
}
...
#{
xcommit2
.
id
}
"
)
xcommit2
=
xproject
.
commit
(
'HEAD~2'
)
@xcommit_range
=
CommitRange
.
new
(
"
#{
xcommit
.
id
}
...
#{
xcommit2
.
id
}
"
,
xproject
)
end
@xcommit_range
...
...
spec/fixtures/markdown.md.erb
View file @
ca268b85
...
...
@@ -127,61 +127,61 @@ But it shouldn't autolink text inside certain tags:
-
<a>
http://about.gitlab.com/
</a>
-
<kbd>
http://about.gitlab.com/
</kbd>
### Reference Filters (e.g.,
#
<%=
issue
.
iid
%>
)
### Reference Filters (e.g.,
<%=
issue
.
to_reference
%>
)
References should be parseable even inside _
!
<%=
merge_request
.
iid
%>
_ emphasis.
References should be parseable even inside _
<%=
merge_request
.
to_reference
%>
_ emphasis.
#### UserReferenceFilter
- All: @all
- User:
@
<%=
user
.
usernam
e
%>
- Group:
@
<%=
group
.
nam
e
%>
- Ignores invalid:
@
fake_user
- Ignored in code: `
@
<%=
user
.
usernam
e
%>
`
- Ignored in links: [Link to
@
<%=
user
.
usernam
e
%>
](#user-link)
- User:
<%=
user
.
to_referenc
e
%>
- Group:
<%=
group
.
to_referenc
e
%>
- Ignores invalid:
<%=
User
.
reference_prefix
%>
fake_user
- Ignored in code: `
<%=
user
.
to_referenc
e
%>
`
- Ignored in links: [Link to
<%=
user
.
to_referenc
e
%>
](#user-link)
#### IssueReferenceFilter
- Issue:
#
<%=
issue
.
iid
%>
- Issue in another project:
<%=
x
ref
%>
#
<%=
xissue
.
iid
%>
- Ignored in code: `
#
<%=
issue
.
iid
%>
`
- Ignored in links: [Link to
#
<%=
issue
.
iid
%>
](#issue-link)
- Issue:
<%=
issue
.
to_reference
%>
- Issue in another project:
<%=
x
issue
.
to_reference
(
project
)
%>
- Ignored in code: `
<%=
issue
.
to_reference
%>
`
- Ignored in links: [Link to
<%=
issue
.
to_reference
%>
](#issue-link)
#### MergeRequestReferenceFilter
- Merge request:
!
<%=
merge_request
.
iid
%>
- Merge request in another project:
<%=
x
ref
%>
!
<%=
xmerge_request
.
iid
%>
- Ignored in code: `
!
<%=
merge_request
.
iid
%>
`
- Ignored in links: [Link to
!
<%=
merge_request
.
iid
%>
](#merge-request-link)
- Merge request:
<%=
merge_request
.
to_reference
%>
- Merge request in another project:
<%=
x
merge_request
.
to_reference
(
project
)
%>
- Ignored in code: `
<%=
merge_request
.
to_reference
%>
`
- Ignored in links: [Link to
<%=
merge_request
.
to_reference
%>
](#merge-request-link)
#### SnippetReferenceFilter
- Snippet:
$
<%=
snippet
.
id
%>
- Snippet in another project:
<%=
x
ref
%>
$
<%=
xsnippet
.
id
%>
- Ignored in code: `
$
<%=
snippet
.
id
%>
`
- Ignored in links: [Link to
$
<%=
snippet
.
id
%>
](#snippet-link)
- Snippet:
<%=
snippet
.
to_reference
%>
- Snippet in another project:
<%=
x
snippet
.
to_reference
(
project
)
%>
- Ignored in code: `
<%=
snippet
.
to_reference
%>
`
- Ignored in links: [Link to
<%=
snippet
.
to_reference
%>
](#snippet-link)
#### CommitRangeReferenceFilter
- Range:
<%=
commit_range
%>
- Range in another project:
<%=
x
ref
%>
@
<%=
xcommit_range
%>
- Ignored in code: `
<%=
commit_range
%>
`
- Ignored in links: [Link to
<%=
commit_range
%>
](#commit-range-link)
- Range:
<%=
commit_range
.
to_reference
%>
- Range in another project:
<%=
x
commit_range
.
to_reference
(
project
)
%>
- Ignored in code: `
<%=
commit_range
.
to_reference
%>
`
- Ignored in links: [Link to
<%=
commit_range
.
to_reference
%>
](#commit-range-link)
#### CommitReferenceFilter
- Commit:
<%=
commit
.
id
%>
- Commit in another project:
<%=
x
ref
%>
@
<%=
xcommit
.
id
%>
- Ignored in code: `
<%=
commit
.
id
%>
`
- Ignored in links: [Link to
<%=
commit
.
id
%>
](#commit-link)
- Commit:
<%=
commit
.
to_reference
%>
- Commit in another project:
<%=
x
commit
.
to_reference
(
project
)
%>
- Ignored in code: `
<%=
commit
.
to_reference
%>
`
- Ignored in links: [Link to
<%=
commit
.
to_reference
%>
](#commit-link)
#### LabelReferenceFilter
- Label by ID:
~
<%=
simple_label
.
id
%>
- Label by name:
~
<%=
simple_label
.
name
%>
- Label by name in quotes:
~"
<%=
label
.
name
%>
"
- Ignored in code: `
~
<%=
simple_label
.
nam
e
%>
`
- Ignored in links: [Link to
~
<%=
simple_label
.
id
%>
](#label-link)
- Label by ID:
<%=
simple_label
.
to_reference
%>
- Label by name:
<%=
Label
.
reference_prefix
%>
<%=
simple_label
.
name
%>
- Label by name in quotes:
<%=
label
.
to_reference
(
:name
)
%>
- Ignored in code: `
<%=
simple_label
.
to_referenc
e
%>
`
- Ignored in links: [Link to
<%=
simple_label
.
to_reference
%>
](#label-link)
### Task Lists
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment