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
Boxiang Sun
gitlab-ce
Commits
6b8d61d1
Commit
6b8d61d1
authored
May 04, 2017
by
Felipe Artur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix specs
parent
4c72a03c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
22 deletions
+2
-22
lib/gitlab/url_sanitizer.rb
lib/gitlab/url_sanitizer.rb
+2
-0
spec/controllers/snippets_controller_spec.rb
spec/controllers/snippets_controller_spec.rb
+0
-22
No files found.
lib/gitlab/url_sanitizer.rb
View file @
6b8d61d1
...
...
@@ -9,6 +9,8 @@ module Gitlab
end
def
self
.
valid?
(
url
)
return
false
unless
url
Addressable
::
URI
.
parse
(
url
.
strip
)
true
...
...
spec/controllers/snippets_controller_spec.rb
View file @
6b8d61d1
...
...
@@ -265,26 +265,6 @@ describe SnippetsController do
end
end
shared_examples
"line endings"
do
|
action
|
context
'CRLF line ending'
do
let
(
:personal_snippet
)
do
create
(
:personal_snippet
,
:public
,
author:
user
,
content:
"first line
\r\n
second line
\r\n
third line"
)
end
it
'returns LF line endings by default'
do
get
action
,
id:
personal_snippet
.
to_param
expect
(
response
.
body
).
to
eq
(
"first line
\n
second line
\n
third line"
)
end
it
'does not convert line endings when parameter present'
do
get
action
,
id:
personal_snippet
.
to_param
,
line_ending: :raw
expect
(
response
.
body
).
to
eq
(
"first line
\r\n
second line
\r\n
third line"
)
end
end
end
shared_examples
'snippet response'
do
|
action
|
context
'when the personal snippet is private'
do
let
(
:personal_snippet
)
{
create
(
:personal_snippet
,
:private
,
author:
user
)
}
...
...
@@ -427,12 +407,10 @@ describe SnippetsController do
end
describe
"GET #raw"
do
include_examples
'line endings'
,
:raw
include_examples
'snippet response'
,
:raw
end
describe
"GET #download"
do
include_examples
'line endings'
,
:download
include_examples
'snippet response'
,
:download
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