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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
528b988a
Commit
528b988a
authored
Sep 26, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Escape HTML nodes in builds commands in ci linter
parent
fca610e5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
2 deletions
+36
-2
app/views/ci/lints/_create.html.haml
app/views/ci/lints/_create.html.haml
+1
-2
spec/views/ci/lints/show.html.haml_spec.rb
spec/views/ci/lints/show.html.haml_spec.rb
+35
-0
No files found.
app/views/ci/lints/_create.html.haml
View file @
528b988a
...
...
@@ -16,8 +16,7 @@
%tr
%td
#{
stage
.
capitalize
}
Job -
#{
build
[
:name
]
}
%td
%pre
=
simple_format
build
[
:commands
]
%pre
=
build
[
:commands
]
%br
%b
Tag list:
...
...
spec/views/ci/lints/show.html.haml_spec.rb
0 → 100644
View file @
528b988a
require
'spec_helper'
describe
'ci/lints/show'
do
include
Devise
::
TestHelpers
before
do
assign
(
:status
,
true
)
assign
(
:stages
,
%w[test]
)
assign
(
:builds
,
builds
)
end
context
'when builds attrbiutes contain HTML nodes'
do
let
(
:builds
)
do
[
{
name:
'rspec'
,
stage:
'test'
,
commands:
'<h1>rspec</h1>'
}
]
end
it
'does not render HTML elements'
do
render
expect
(
rendered
).
not_to
have_css
(
'h1'
,
text:
'rspec'
)
end
end
context
'when builds attributes do not contain HTML nodes'
do
let
(
:builds
)
do
[
{
name:
'rspec'
,
stage:
'test'
,
commands:
'rspec'
}
]
end
it
'shows configuration in the table'
do
render
expect
(
rendered
).
to
have_css
(
'td pre'
,
text:
'rspec'
)
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