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
7efa4e14
Commit
7efa4e14
authored
Sep 03, 2020
by
David Fernandez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unused functions
in `API::Helpers::PackagesManagerClientsHelpers`
parent
2881d5c4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
48 deletions
+0
-48
lib/api/helpers/packages_manager_clients_helpers.rb
lib/api/helpers/packages_manager_clients_helpers.rb
+0
-16
spec/lib/api/helpers/packages_manager_clients_helpers_spec.rb
.../lib/api/helpers/packages_manager_clients_helpers_spec.rb
+0
-32
No files found.
lib/api/helpers/packages_manager_clients_helpers.rb
View file @
7efa4e14
...
...
@@ -6,16 +6,6 @@ module API
extend
Grape
::
API
::
Helpers
include
::
API
::
Helpers
::
PackagesHelpers
params
:workhorse_upload_params
do
optional
'file.path'
,
type:
String
,
desc:
'Path to locally stored body (generated by Workhorse)'
optional
'file.name'
,
type:
String
,
desc:
'Real filename as send in Content-Disposition (generated by Workhorse)'
optional
'file.type'
,
type:
String
,
desc:
'Real content type as send in Content-Type (generated by Workhorse)'
optional
'file.size'
,
type:
Integer
,
desc:
'Real size of file (generated by Workhorse)'
optional
'file.md5'
,
type:
String
,
desc:
'MD5 checksum of the file (generated by Workhorse)'
optional
'file.sha1'
,
type:
String
,
desc:
'SHA1 checksum of the file (generated by Workhorse)'
optional
'file.sha256'
,
type:
String
,
desc:
'SHA256 checksum of the file (generated by Workhorse)'
end
def
find_job_from_http_basic_auth
return
unless
request
.
headers
...
...
@@ -36,12 +26,6 @@ module API
DeployToken
.
active
.
find_by_token
(
token
)
end
def
uploaded_package_file
(
param_name
=
:file
)
uploaded_file
=
UploadedFile
.
from_params
(
params
,
param_name
,
::
Packages
::
PackageFileUploader
.
workhorse_local_upload_path
)
bad_request!
(
'Missing package file!'
)
unless
uploaded_file
uploaded_file
end
private
def
decode_token
...
...
spec/lib/api/helpers/packages_manager_clients_helpers_spec.rb
View file @
7efa4e14
...
...
@@ -86,36 +86,4 @@ RSpec.describe API::Helpers::PackagesManagerClientsHelpers do
it_behaves_like
'invalid auth header'
end
describe
'#uploaded_package_file'
do
let_it_be
(
:params
)
{
{}
}
subject
{
helper
.
uploaded_package_file
}
before
do
allow
(
helper
).
to
receive
(
:params
).
and_return
(
params
)
end
context
'with valid uploaded package file'
do
let_it_be
(
:uploaded_file
)
{
Object
.
new
}
before
do
allow
(
UploadedFile
).
to
receive
(
:from_params
).
and_return
(
uploaded_file
)
end
it
{
is_expected
.
to
be
uploaded_file
}
end
context
'with invalid uploaded package file'
do
before
do
allow
(
UploadedFile
).
to
receive
(
:from_params
).
and_return
(
nil
)
end
it
'fails with bad_request!'
do
expect
(
helper
).
to
receive
(
:bad_request!
)
expect
(
subject
).
to
be
nil
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