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
aa3a3fd1
Commit
aa3a3fd1
authored
Jun 28, 2016
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup the tests a bit in order to extend it
parent
c9a46263
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
15 deletions
+34
-15
spec/requests/ci/api/builds_spec.rb
spec/requests/ci/api/builds_spec.rb
+34
-15
No files found.
spec/requests/ci/api/builds_spec.rb
View file @
aa3a3fd1
...
@@ -295,31 +295,50 @@ describe Ci::API::API do
...
@@ -295,31 +295,50 @@ describe Ci::API::API do
context
'build has been erased'
do
context
'build has been erased'
do
let
(
:build
)
{
create
(
:ci_build
,
erased_at:
Time
.
now
)
}
let
(
:build
)
{
create
(
:ci_build
,
erased_at:
Time
.
now
)
}
before
{
upload_artifacts
(
file_upload
,
headers_with_token
)
}
before
do
upload_artifacts
(
file_upload
,
headers_with_token
)
end
it
'should respond with forbidden'
do
it
'should respond with forbidden'
do
expect
(
response
.
status
).
to
eq
403
expect
(
response
.
status
).
to
eq
403
end
end
end
end
context
"should post artifact to running build"
do
context
'should post artifact to running build'
do
it
"uses regual file post"
do
shared_examples
'post artifact'
do
upload_artifacts
(
file_upload
,
headers_with_token
,
false
)
it
'updates successfully'
do
response_filename
=
json_response
[
"artifacts_file"
][
"filename"
]
expect
(
response
).
to
have_http_status
(
201
)
expect
(
response
).
to
have_http_status
(
201
)
expect
(
json_response
[
"artifacts_file"
][
"filename"
]).
to
eq
(
file_upload
.
original_filename
)
expect
(
response_filename
).
to
eq
(
file_upload
.
original_filename
)
end
end
context
'uses regular file post'
do
before
do
upload_artifacts
(
file_upload
,
headers_with_token
,
false
)
end
end
it
"uses accelerated file post"
do
it_behaves_like
'post artifact'
end
context
'uses accelerated file post'
do
before
do
upload_artifacts
(
file_upload
,
headers_with_token
,
true
)
upload_artifacts
(
file_upload
,
headers_with_token
,
true
)
expect
(
response
).
to
have_http_status
(
201
)
expect
(
json_response
[
"artifacts_file"
][
"filename"
]).
to
eq
(
file_upload
.
original_filename
)
end
end
it
"updates artifact"
do
it_behaves_like
'post artifact'
upload_artifacts
(
file_upload
,
headers_with_token
)
end
context
'updates artifact'
do
before
do
upload_artifacts
(
file_upload2
,
headers_with_token
)
upload_artifacts
(
file_upload2
,
headers_with_token
)
expect
(
response
).
to
have_http_status
(
201
)
upload_artifacts
(
file_upload
,
headers_with_token
)
expect
(
json_response
[
"artifacts_file"
][
"filename"
]).
to
eq
(
file_upload2
.
original_filename
)
end
it_behaves_like
'post artifact'
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