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
Jérome Perrin
gitlab-ce
Commits
d23337fd
Commit
d23337fd
authored
Mar 07, 2018
by
haseeb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix failing spec
parent
101c3708
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
app/helpers/snippets_helper.rb
app/helpers/snippets_helper.rb
+1
-1
spec/helpers/snippets_helper_spec.rb
spec/helpers/snippets_helper_spec.rb
+4
-4
No files found.
app/helpers/snippets_helper.rb
View file @
d23337fd
...
...
@@ -126,7 +126,7 @@ module SnippetsHelper
raw_project_snippet_url
(
@snippet
.
project
,
@snippet
,
inline:
false
)
end
link_to
external_snippet_icon
(
'download'
),
download_url
,
class:
'btn'
,
target:
'_blank'
,
title:
'Download'
,
data:
{
container:
'body'
},
rel:
'noopener noreferrer'
link_to
external_snippet_icon
(
'download'
),
download_url
,
class:
'btn'
,
target:
'_blank'
,
title:
'Download'
,
rel:
'noopener noreferrer'
end
def
public_snippet?
...
...
spec/helpers/snippets_helper_spec.rb
View file @
d23337fd
...
...
@@ -7,13 +7,13 @@ describe SnippetsHelper do
it
'gives view raw button of embedded snippets for project snippets'
do
@snippet
=
create
(
:project_snippet
,
:public
)
expect
(
embedded_snippet_raw_button
.
to_s
).
to
eq
(
"<a class=
\"
btn
\"
target=
\"
_blank
\"
rel=
\"
noopener noreferrer
\"
title=
\"
Open raw
\"
data-container=
\"
body
\"
href=
\"
#{
raw_project_snippet_url
(
@snippet
.
project
,
@snippet
)
}
\"
>
#{
external_snippet_icon
(
'doc_code'
)
}
</a>"
)
expect
(
embedded_snippet_raw_button
.
to_s
).
to
eq
(
"<a class=
\"
btn
\"
target=
\"
_blank
\"
rel=
\"
noopener noreferrer
\"
title=
\"
Open raw
\"
href=
\"
#{
raw_project_snippet_url
(
@snippet
.
project
,
@snippet
)
}
\"
>
#{
external_snippet_icon
(
'doc_code'
)
}
</a>"
)
end
it
'gives view raw button of embedded snippets for personal snippets'
do
@snippet
=
create
(
:personal_snippet
,
:public
)
expect
(
embedded_snippet_raw_button
.
to_s
).
to
eq
(
"<a class=
\"
btn
\"
target=
\"
_blank
\"
rel=
\"
noopener noreferrer
\"
title=
\"
Open raw
\"
data-container=
\"
body
\"
href=
\"
#{
raw_snippet_url
(
@snippet
)
}
\"
>
#{
external_snippet_icon
(
'doc_code'
)
}
</a>"
)
expect
(
embedded_snippet_raw_button
.
to_s
).
to
eq
(
"<a class=
\"
btn
\"
target=
\"
_blank
\"
rel=
\"
noopener noreferrer
\"
title=
\"
Open raw
\"
href=
\"
#{
raw_snippet_url
(
@snippet
)
}
\"
>
#{
external_snippet_icon
(
'doc_code'
)
}
</a>"
)
end
end
...
...
@@ -21,13 +21,13 @@ describe SnippetsHelper do
it
'gives download button of embedded snippets for project snippets'
do
@snippet
=
create
(
:project_snippet
,
:public
)
expect
(
embedded_snippet_download_button
.
to_s
).
to
eq
(
"<a class=
\"
btn
\"
target=
\"
_blank
\"
title=
\"
Download
\"
data-container=
\"
body
\"
rel=
\"
noopener noreferrer
\"
href=
\"
#{
raw_project_snippet_url
(
@snippet
.
project
,
@snippet
,
inline:
false
)
}
\"
>
#{
external_snippet_icon
(
'download'
)
}
</a>"
)
expect
(
embedded_snippet_download_button
.
to_s
).
to
eq
(
"<a class=
\"
btn
\"
target=
\"
_blank
\"
title=
\"
Download
\"
rel=
\"
noopener noreferrer
\"
href=
\"
#{
raw_project_snippet_url
(
@snippet
.
project
,
@snippet
,
inline:
false
)
}
\"
>
#{
external_snippet_icon
(
'download'
)
}
</a>"
)
end
it
'gives download button of embedded snippets for personal snippets'
do
@snippet
=
create
(
:personal_snippet
,
:public
)
expect
(
embedded_snippet_download_button
.
to_s
).
to
eq
(
"<a class=
\"
btn
\"
target=
\"
_blank
\"
title=
\"
Download
\"
data-container=
\"
body
\"
rel=
\"
noopener noreferrer
\"
href=
\"
#{
raw_snippet_url
(
@snippet
,
inline:
false
)
}
\"
>
#{
external_snippet_icon
(
'download'
)
}
</a>"
)
expect
(
embedded_snippet_download_button
.
to_s
).
to
eq
(
"<a class=
\"
btn
\"
target=
\"
_blank
\"
title=
\"
Download
\"
rel=
\"
noopener noreferrer
\"
href=
\"
#{
raw_snippet_url
(
@snippet
,
inline:
false
)
}
\"
>
#{
external_snippet_icon
(
'download'
)
}
</a>"
)
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