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
b043729d
Commit
b043729d
authored
Jul 13, 2016
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Share more stuffs
parent
8735d95a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
24 deletions
+22
-24
spec/requests/api/artifacts_spec.rb
spec/requests/api/artifacts_spec.rb
+2
-11
spec/requests/projects/artifacts_controller_spec.rb
spec/requests/projects/artifacts_controller_spec.rb
+5
-11
spec/requests/shared/artifacts_context.rb
spec/requests/shared/artifacts_context.rb
+15
-2
No files found.
spec/requests/api/artifacts_spec.rb
View file @
b043729d
...
...
@@ -4,18 +4,9 @@ require_relative '../shared/artifacts_context'
describe
API
::
API
,
api:
true
do
include
ApiHelpers
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:pipeline
)
do
create
(
:ci_pipeline
,
project:
project
,
sha:
project
.
commit
(
'fix'
).
sha
)
end
let
(
:build
)
{
create
(
:ci_build
,
:success
,
:artifacts
,
pipeline:
pipeline
)
}
before
do
project
.
team
<<
[
user
,
:developer
]
end
describe
'GET /projects/:id/artifacts/:ref_name/:build_name'
do
include_context
'artifacts from ref and build name'
def
path_from_ref
(
ref
=
pipeline
.
sha
,
build_name
=
build
.
name
,
_
=
''
)
api
(
"/projects/
#{
project
.
id
}
/artifacts/
#{
ref
}
/
#{
build_name
}
"
,
user
)
end
...
...
spec/requests/projects/artifacts_controller_spec.rb
View file @
b043729d
...
...
@@ -2,19 +2,13 @@ require 'spec_helper'
require_relative
'../shared/artifacts_context'
describe
Projects
::
ArtifactsController
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:pipeline
)
do
create
(
:ci_pipeline
,
project:
project
,
sha:
project
.
commit
(
'fix'
).
sha
)
end
let
(
:build
)
{
create
(
:ci_build
,
:success
,
:artifacts
,
pipeline:
pipeline
)
}
describe
'GET /:project/artifacts/:ref/:build_name/browse'
do
include_context
'artifacts from ref and build name'
before
do
login_as
(
user
)
project
.
team
<<
[
user
,
:developer
]
end
before
do
login_as
(
user
)
end
describe
'GET /:project/artifacts/:ref/:build_name/browse'
do
def
path_from_ref
(
ref
=
pipeline
.
sha
,
build_name
=
build
.
name
,
path
=
'browse'
)
search_namespace_project_artifacts_path
(
...
...
spec/requests/shared/artifacts_context.rb
View file @
b043729d
shared_context
'artifacts from ref with 404'
do
shared_context
'artifacts from ref and build name'
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:pipeline
)
do
create
(
:ci_pipeline
,
project:
project
,
sha:
project
.
commit
(
'fix'
).
sha
)
end
let
(
:build
)
{
create
(
:ci_build
,
:success
,
:artifacts
,
pipeline:
pipeline
)
}
before
do
project
.
team
<<
[
user
,
:developer
]
end
end
shared_examples
'artifacts from ref with 404'
do
context
'has no such ref'
do
before
do
get
path_from_ref
(
'TAIL'
,
build
.
name
)
...
...
@@ -16,7 +29,7 @@ shared_context 'artifacts from ref with 404' do
end
end
shared_
context
'artifacts from ref with 302'
do
shared_
examples
'artifacts from ref with 302'
do
context
'with sha'
do
before
do
get
path_from_ref
...
...
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