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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kazuhiko Shiozaki
gitlab-ce
Commits
281643a1
Commit
281643a1
authored
May 23, 2014
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add feature spec.
parent
603e04bc
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
3 deletions
+21
-3
features/project/issues/issues.feature
features/project/issues/issues.feature
+6
-0
features/steps/project/issues.rb
features/steps/project/issues.rb
+12
-0
lib/redcarpet/render/gitlab_html.rb
lib/redcarpet/render/gitlab_html.rb
+3
-3
No files found.
features/project/issues/issues.feature
View file @
281643a1
...
@@ -68,6 +68,12 @@ Feature: Project Issues
...
@@ -68,6 +68,12 @@ Feature: Project Issues
And
I leave a comment with a header containing
"Comment with a header"
And
I leave a comment with a header containing
"Comment with a header"
Then
The comment with the header should not have an ID
Then
The comment with the header should not have an ID
@javascript
Scenario
:
Blocks inside comments should not build relative links
Given
I visit issue page
"Release 0.4"
And
I leave a comment with code block
Then
The code block should be unchanged
Scenario
:
Issues on empty project
Scenario
:
Issues on empty project
Given
empty project
"Empty Project"
Given
empty project
"Empty Project"
When
I visit empty project page
When
I visit empty project page
...
...
features/steps/project/issues.rb
View file @
281643a1
...
@@ -163,4 +163,16 @@ class ProjectIssues < Spinach::FeatureSteps
...
@@ -163,4 +163,16 @@ class ProjectIssues < Spinach::FeatureSteps
project
=
Project
.
find_by
(
name:
'Empty Project'
)
project
=
Project
.
find_by
(
name:
'Empty Project'
)
visit
project_issues_path
(
project
)
visit
project_issues_path
(
project
)
end
end
step
'I leave a comment with code block'
do
within
(
".js-main-target-form"
)
do
fill_in
"note[note]"
,
with:
"```
\n
Command [1]: /usr/local/bin/git , see [text](doc/text)
\n
```"
click_button
"Add Comment"
sleep
0.05
end
end
step
'The code block should be unchanged'
do
page
.
should
have_content
(
"```
\n
Command [1]: /usr/local/bin/git , see [text](doc/text)
\n
```"
)
end
end
end
lib/redcarpet/render/gitlab_html.rb
View file @
281643a1
...
@@ -6,8 +6,6 @@ class Redcarpet::Render::GitlabHTML < Redcarpet::Render::HTML
...
@@ -6,8 +6,6 @@ class Redcarpet::Render::GitlabHTML < Redcarpet::Render::HTML
def
initialize
(
template
,
options
=
{})
def
initialize
(
template
,
options
=
{})
@template
=
template
@template
=
template
@project
=
@template
.
instance_variable_get
(
"@project"
)
@project
=
@template
.
instance_variable_get
(
"@project"
)
@ref
=
@template
.
instance_variable_get
(
"@ref"
)
@request_path
=
@template
.
instance_variable_get
(
"@path"
)
@options
=
options
.
dup
@options
=
options
.
dup
super
options
super
options
end
end
...
@@ -46,7 +44,9 @@ class Redcarpet::Render::GitlabHTML < Redcarpet::Render::HTML
...
@@ -46,7 +44,9 @@ class Redcarpet::Render::GitlabHTML < Redcarpet::Render::HTML
end
end
def
postprocess
(
full_document
)
def
postprocess
(
full_document
)
unless
@template
.
instance_variable_get
(
"@project_wiki"
)
||
@project
.
nil?
full_document
=
h
.
create_relative_links
(
full_document
)
full_document
=
h
.
create_relative_links
(
full_document
)
end
h
.
gfm
(
full_document
)
h
.
gfm
(
full_document
)
end
end
end
end
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