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
4af52536
Commit
4af52536
authored
Nov 27, 2017
by
Zeger-Jan van de Weg
Committed by
Kamil Trzcinski
Dec 03, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Another round of fixes
parent
15056fc4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
11 deletions
+9
-11
app/controllers/projects/artifacts_controller.rb
app/controllers/projects/artifacts_controller.rb
+2
-3
spec/controllers/projects/artifacts_controller_spec.rb
spec/controllers/projects/artifacts_controller_spec.rb
+6
-7
spec/serializers/pipeline_serializer_spec.rb
spec/serializers/pipeline_serializer_spec.rb
+1
-1
No files found.
app/controllers/projects/artifacts_controller.rb
View file @
4af52536
...
...
@@ -42,8 +42,7 @@ class Projects::ArtifactsController < Projects::ApplicationController
end
def
raw
path
=
Gitlab
::
Ci
::
Build
::
Artifacts
::
Path
.
new
(
params
[
:path
])
path
=
Gitlab
::
Ci
::
Build
::
Artifacts
::
Path
.
new
(
params
[
:path
])
send_artifacts_entry
(
build
,
path
)
end
...
...
@@ -72,7 +71,7 @@ class Projects::ArtifactsController < Projects::ApplicationController
end
def
validate_artifacts!
render_404
unless
build
&&
build
.
artifacts?
render_404
unless
build
&
.
artifacts?
end
def
build
...
...
spec/controllers/projects/artifacts_controller_spec.rb
View file @
4af52536
require
'spec_helper'
describe
Projects
::
ArtifactsController
do
set
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
project
.
owner
}
set
(
:project
)
{
create
(
:project
,
:repository
,
:public
)
}
let
(
:pipeline
)
do
...
...
@@ -15,8 +15,6 @@ describe Projects::ArtifactsController do
let
(
:job
)
{
create
(
:ci_build
,
:success
,
:artifacts
,
pipeline:
pipeline
)
}
before
do
project
.
add_developer
(
user
)
sign_in
(
user
)
end
...
...
@@ -117,14 +115,12 @@ describe Projects::ArtifactsController do
context
'when the file exists'
do
let
(
:path
)
{
'ci_artifacts.txt'
}
let
(
:job
)
{
create
(
:ci_build
,
:success
,
pipeline:
pipeline
)
}
shared_examples
'a valid file'
do
let!
(
:artifact
)
{
create
(
:ci_job_artifact
,
job:
job
,
file_store:
store
)
}
it
'serves the file using workhorse'
do
subject
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
send_data
).
to
start_with
(
'artifacts-entry:'
)
expect
(
params
.
keys
).
to
eq
(
%w(Archive Entry)
)
...
...
@@ -148,8 +144,9 @@ describe Projects::ArtifactsController do
context
'when using local file storage'
do
it_behaves_like
'a valid file'
do
let
(
:job
)
{
create
(
:ci_build
,
:success
,
:artifacts
,
pipeline:
pipeline
)
}
let
(
:store
)
{
ObjectStoreUploader
::
LOCAL_STORE
}
let
(
:archive_path
)
{
Legacy
ArtifactUploader
.
local_store_path
}
let
(
:archive_path
)
{
Job
ArtifactUploader
.
local_store_path
}
end
end
...
...
@@ -159,6 +156,8 @@ describe Projects::ArtifactsController do
end
it_behaves_like
'a valid file'
do
let!
(
:artifact
)
{
create
(
:ci_job_artifact
,
:archive
,
:remote_store
,
job:
job
)
}
let!
(
:job
)
{
create
(
:ci_build
,
:success
,
pipeline:
pipeline
)
}
let
(
:store
)
{
ObjectStoreUploader
::
REMOTE_STORE
}
let
(
:archive_path
)
{
'https://'
}
end
...
...
spec/serializers/pipeline_serializer_spec.rb
View file @
4af52536
...
...
@@ -118,7 +118,7 @@ describe PipelineSerializer do
it
'verifies number of queries'
,
:request_store
do
recorded
=
ActiveRecord
::
QueryRecorder
.
new
{
subject
}
expect
(
recorded
.
count
).
to
be_within
(
1
).
of
(
36
)
expect
(
recorded
.
count
).
to
be_within
(
1
).
of
(
40
)
expect
(
recorded
.
cached_count
).
to
eq
(
0
)
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