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
Léo-Paul Géneau
gitlab-ce
Commits
a6536a84
Commit
a6536a84
authored
Apr 20, 2017
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix some specs
parent
cc3e488c
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
9 deletions
+7
-9
app/helpers/blob_helper.rb
app/helpers/blob_helper.rb
+0
-2
app/views/projects/blob/_header.html.haml
app/views/projects/blob/_header.html.haml
+1
-1
app/views/shared/snippets/_blob.html.haml
app/views/shared/snippets/_blob.html.haml
+1
-1
spec/features/projects/files/browse_files_spec.rb
spec/features/projects/files/browse_files_spec.rb
+3
-2
spec/helpers/blob_helper_spec.rb
spec/helpers/blob_helper_spec.rb
+2
-3
No files found.
app/helpers/blob_helper.rb
View file @
a6536a84
...
@@ -209,8 +209,6 @@ module BlobHelper
...
@@ -209,8 +209,6 @@ module BlobHelper
end
end
def
copy_blob_source_button
(
blob
)
def
copy_blob_source_button
(
blob
)
return
unless
blob
.
rendered_as_text?
(
override_max_size:
params
[
:override_max_size
])
clipboard_button
(
target:
".blob-content[data-blob-id='
#{
blob
.
id
}
']"
,
class:
"btn btn-sm js-copy-blob-source-btn"
,
title:
"Copy source to clipboard"
)
clipboard_button
(
target:
".blob-content[data-blob-id='
#{
blob
.
id
}
']"
,
class:
"btn btn-sm js-copy-blob-source-btn"
,
title:
"Copy source to clipboard"
)
end
end
...
...
app/views/projects/blob/_header.html.haml
View file @
a6536a84
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
=
render
'projects/blob/viewer_switcher'
,
blob:
blob
unless
blame
=
render
'projects/blob/viewer_switcher'
,
blob:
blob
unless
blame
.btn-group
{
role:
"group"
}
<
.btn-group
{
role:
"group"
}
<
=
copy_blob_source_button
(
blob
)
unless
blame
=
copy_blob_source_button
(
blob
)
if
!
blame
&&
blob
.
rendered_as_text?
(
override_max_size:
params
[
:override_max_size
])
=
open_raw_file_button
(
namespace_project_raw_path
(
@project
.
namespace
,
@project
,
@id
))
=
open_raw_file_button
(
namespace_project_raw_path
(
@project
.
namespace
,
@project
,
@id
))
=
view_on_environment_button
(
@commit
.
sha
,
@path
,
@environment
)
if
@environment
=
view_on_environment_button
(
@commit
.
sha
,
@path
,
@environment
)
if
@environment
...
...
app/views/shared/snippets/_blob.html.haml
View file @
a6536a84
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
.file-actions.hidden-xs
.file-actions.hidden-xs
.btn-group
{
role:
"group"
}
<
.btn-group
{
role:
"group"
}
<
=
copy_blob_
content
_button
(
@snippet
)
=
copy_blob_
source
_button
(
@snippet
)
=
open_raw_file_button
(
raw_path
)
=
open_raw_file_button
(
raw_path
)
-
if
defined?
(
download_path
)
&&
download_path
-
if
defined?
(
download_path
)
&&
download_path
...
...
spec/features/projects/files/browse_files_spec.rb
View file @
a6536a84
require
'spec_helper'
require
'spec_helper'
feature
'user browses project'
,
feature:
true
do
feature
'user browses project'
,
feature:
true
,
js:
true
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
...
@@ -24,6 +24,7 @@ feature 'user browses project', feature: true do
...
@@ -24,6 +24,7 @@ feature 'user browses project', feature: true do
click_link
'files'
click_link
'files'
click_link
'lfs'
click_link
'lfs'
click_link
'lfs_object.iso'
click_link
'lfs_object.iso'
wait_for_ajax
expect
(
page
).
not_to
have_content
'Download (1.5 MB)'
expect
(
page
).
not_to
have_content
'Download (1.5 MB)'
expect
(
page
).
to
have_content
'version https://git-lfs.github.com/spec/v1'
expect
(
page
).
to
have_content
'version https://git-lfs.github.com/spec/v1'
...
...
spec/helpers/blob_helper_spec.rb
View file @
a6536a84
...
@@ -56,15 +56,14 @@ describe BlobHelper do
...
@@ -56,15 +56,14 @@ describe BlobHelper do
end
end
end
end
describe
"#sanitize_svg"
do
describe
"#sanitize_svg
_data
"
do
let
(
:input_svg_path
)
{
File
.
join
(
Rails
.
root
,
'spec'
,
'fixtures'
,
'unsanitized.svg'
)
}
let
(
:input_svg_path
)
{
File
.
join
(
Rails
.
root
,
'spec'
,
'fixtures'
,
'unsanitized.svg'
)
}
let
(
:data
)
{
open
(
input_svg_path
).
read
}
let
(
:data
)
{
open
(
input_svg_path
).
read
}
let
(
:expected_svg_path
)
{
File
.
join
(
Rails
.
root
,
'spec'
,
'fixtures'
,
'sanitized.svg'
)
}
let
(
:expected_svg_path
)
{
File
.
join
(
Rails
.
root
,
'spec'
,
'fixtures'
,
'sanitized.svg'
)
}
let
(
:expected
)
{
open
(
expected_svg_path
).
read
}
let
(
:expected
)
{
open
(
expected_svg_path
).
read
}
it
'retains essential elements'
do
it
'retains essential elements'
do
blob
=
OpenStruct
.
new
(
data:
data
)
expect
(
sanitize_svg_data
(
data
)).
to
eq
(
expected
)
expect
(
sanitize_svg
(
blob
).
data
).
to
eq
(
expected
)
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