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
...
@@ -344,13 +344,13 @@ class MarkdownFeature
end
end
def
commit
def
commit
@commit
||=
project
.
repository
.
commit
@commit
||=
project
.
commit
end
end
def
commit_range
def
commit_range
unless
@commit_range
unless
@commit_range
commit2
=
project
.
repository
.
commit
(
'HEAD~3'
)
commit2
=
project
.
commit
(
'HEAD~3'
)
@commit_range
=
CommitRange
.
new
(
"
#{
commit
.
id
}
...
#{
commit2
.
id
}
"
)
@commit_range
=
CommitRange
.
new
(
"
#{
commit
.
id
}
...
#{
commit2
.
id
}
"
,
project
)
end
end
@commit_range
@commit_range
...
@@ -376,11 +376,6 @@ class MarkdownFeature
...
@@ -376,11 +376,6 @@ class MarkdownFeature
@xproject
@xproject
end
end
# Shortcut to "cross-reference/project"
def
xref
xproject
.
path_with_namespace
end
def
xissue
def
xissue
@xissue
||=
create
(
:issue
,
project:
xproject
)
@xissue
||=
create
(
:issue
,
project:
xproject
)
end
end
...
@@ -394,13 +389,13 @@ class MarkdownFeature
...
@@ -394,13 +389,13 @@ class MarkdownFeature
end
end
def
xcommit
def
xcommit
@xcommit
||=
xproject
.
repository
.
commit
@xcommit
||=
xproject
.
commit
end
end
def
xcommit_range
def
xcommit_range
unless
@xcommit_range
unless
@xcommit_range
xcommit2
=
xproject
.
repository
.
commit
(
'HEAD~2'
)
xcommit2
=
xproject
.
commit
(
'HEAD~2'
)
@xcommit_range
=
CommitRange
.
new
(
"
#{
xcommit
.
id
}
...
#{
xcommit2
.
id
}
"
)
@xcommit_range
=
CommitRange
.
new
(
"
#{
xcommit
.
id
}
...
#{
xcommit2
.
id
}
"
,
xproject
)
end
end
@xcommit_range
@xcommit_range
...
...
spec/fixtures/markdown.md.erb
View file @
ca268b85
...
@@ -127,61 +127,61 @@ But it shouldn't autolink text inside certain tags:
...
@@ -127,61 +127,61 @@ But it shouldn't autolink text inside certain tags:
-
<a>
http://about.gitlab.com/
</a>
-
<a>
http://about.gitlab.com/
</a>
-
<kbd>
http://about.gitlab.com/
</kbd>
-
<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
#### UserReferenceFilter
- All: @all
- All: @all
- User:
@
<%=
user
.
usernam
e
%>
- User:
<%=
user
.
to_referenc
e
%>
- Group:
@
<%=
group
.
nam
e
%>
- Group:
<%=
group
.
to_referenc
e
%>
- Ignores invalid:
@
fake_user
- Ignores invalid:
<%=
User
.
reference_prefix
%>
fake_user
- Ignored in code: `
@
<%=
user
.
usernam
e
%>
`
- Ignored in code: `
<%=
user
.
to_referenc
e
%>
`
- Ignored in links: [Link to
@
<%=
user
.
usernam
e
%>
](#user-link)
- Ignored in links: [Link to
<%=
user
.
to_referenc
e
%>
](#user-link)
#### IssueReferenceFilter
#### IssueReferenceFilter
- Issue:
#
<%=
issue
.
iid
%>
- Issue:
<%=
issue
.
to_reference
%>
- Issue in another project:
<%=
x
ref
%>
#
<%=
xissue
.
iid
%>
- Issue in another project:
<%=
x
issue
.
to_reference
(
project
)
%>
- Ignored in code: `
#
<%=
issue
.
iid
%>
`
- Ignored in code: `
<%=
issue
.
to_reference
%>
`
- Ignored in links: [Link to
#
<%=
issue
.
iid
%>
](#issue-link)
- Ignored in links: [Link to
<%=
issue
.
to_reference
%>
](#issue-link)
#### MergeRequestReferenceFilter
#### MergeRequestReferenceFilter
- Merge request:
!
<%=
merge_request
.
iid
%>
- Merge request:
<%=
merge_request
.
to_reference
%>
- Merge request in another project:
<%=
x
ref
%>
!
<%=
xmerge_request
.
iid
%>
- Merge request in another project:
<%=
x
merge_request
.
to_reference
(
project
)
%>
- Ignored in code: `
!
<%=
merge_request
.
iid
%>
`
- Ignored in code: `
<%=
merge_request
.
to_reference
%>
`
- Ignored in links: [Link to
!
<%=
merge_request
.
iid
%>
](#merge-request-link)
- Ignored in links: [Link to
<%=
merge_request
.
to_reference
%>
](#merge-request-link)
#### SnippetReferenceFilter
#### SnippetReferenceFilter
- Snippet:
$
<%=
snippet
.
id
%>
- Snippet:
<%=
snippet
.
to_reference
%>
- Snippet in another project:
<%=
x
ref
%>
$
<%=
xsnippet
.
id
%>
- Snippet in another project:
<%=
x
snippet
.
to_reference
(
project
)
%>
- Ignored in code: `
$
<%=
snippet
.
id
%>
`
- Ignored in code: `
<%=
snippet
.
to_reference
%>
`
- Ignored in links: [Link to
$
<%=
snippet
.
id
%>
](#snippet-link)
- Ignored in links: [Link to
<%=
snippet
.
to_reference
%>
](#snippet-link)
#### CommitRangeReferenceFilter
#### CommitRangeReferenceFilter
- Range:
<%=
commit_range
%>
- Range:
<%=
commit_range
.
to_reference
%>
- Range in another project:
<%=
x
ref
%>
@
<%=
xcommit_range
%>
- Range in another project:
<%=
x
commit_range
.
to_reference
(
project
)
%>
- Ignored in code: `
<%=
commit_range
%>
`
- Ignored in code: `
<%=
commit_range
.
to_reference
%>
`
- Ignored in links: [Link to
<%=
commit_range
%>
](#commit-range-link)
- Ignored in links: [Link to
<%=
commit_range
.
to_reference
%>
](#commit-range-link)
#### CommitReferenceFilter
#### CommitReferenceFilter
- Commit:
<%=
commit
.
id
%>
- Commit:
<%=
commit
.
to_reference
%>
- Commit in another project:
<%=
x
ref
%>
@
<%=
xcommit
.
id
%>
- Commit in another project:
<%=
x
commit
.
to_reference
(
project
)
%>
- Ignored in code: `
<%=
commit
.
id
%>
`
- Ignored in code: `
<%=
commit
.
to_reference
%>
`
- Ignored in links: [Link to
<%=
commit
.
id
%>
](#commit-link)
- Ignored in links: [Link to
<%=
commit
.
to_reference
%>
](#commit-link)
#### LabelReferenceFilter
#### LabelReferenceFilter
- Label by ID:
~
<%=
simple_label
.
id
%>
- Label by ID:
<%=
simple_label
.
to_reference
%>
- Label by name:
~
<%=
simple_label
.
name
%>
- Label by name:
<%=
Label
.
reference_prefix
%>
<%=
simple_label
.
name
%>
- Label by name in quotes:
~"
<%=
label
.
name
%>
"
- Label by name in quotes:
<%=
label
.
to_reference
(
:name
)
%>
- Ignored in code: `
~
<%=
simple_label
.
nam
e
%>
`
- Ignored in code: `
<%=
simple_label
.
to_referenc
e
%>
`
- Ignored in links: [Link to
~
<%=
simple_label
.
id
%>
](#label-link)
- Ignored in links: [Link to
<%=
simple_label
.
to_reference
%>
](#label-link)
### Task Lists
### 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