BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
ac872078
Commit
ac872078
authored
Feb 14, 2017
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test build API if expire_in not set, set to app default
parent
3e158bec
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
2 deletions
+17
-2
builds_spec.rb
spec/requests/ci/api/builds_spec.rb
+17
-2
No files found.
spec/requests/ci/api/builds_spec.rb
View file @
ac872078
...
...
@@ -630,6 +630,7 @@ describe Ci::API::Builds do
context
'with an expire date'
do
let!
(
:artifacts
)
{
file_upload
}
let
(
:default_artifacts_expiration
)
{
0
}
let
(
:post_data
)
do
{
'file.path'
=>
artifacts
.
path
,
...
...
@@ -638,7 +639,8 @@ describe Ci::API::Builds do
end
before
do
stub_application_setting
(
default_artifacts_expiration:
0
)
stub_application_setting
(
default_artifacts_expiration:
default_artifacts_expiration
)
post
(
post_url
,
post_data
,
headers_with_token
)
end
...
...
@@ -650,7 +652,8 @@ describe Ci::API::Builds do
build
.
reload
expect
(
response
).
to
have_http_status
(
201
)
expect
(
json_response
[
'artifacts_expire_at'
]).
not_to
be_empty
expect
(
build
.
artifacts_expire_at
).
to
be_within
(
5
.
minutes
).
of
(
Time
.
now
+
7
.
days
)
expect
(
build
.
artifacts_expire_at
).
to
be_within
(
5
.
minutes
).
of
(
7
.
days
.
from_now
)
end
end
...
...
@@ -663,6 +666,18 @@ describe Ci::API::Builds do
expect
(
json_response
[
'artifacts_expire_at'
]).
to
be_nil
expect
(
build
.
artifacts_expire_at
).
to
be_nil
end
context
'with application default'
do
let
(
:default_artifacts_expiration
)
{
5
}
it
'sets to application default'
do
build
.
reload
expect
(
response
).
to
have_http_status
(
201
)
expect
(
json_response
[
'artifacts_expire_at'
]).
not_to
be_empty
expect
(
build
.
artifacts_expire_at
).
to
be_within
(
5
.
minutes
).
of
(
5
.
days
.
from_now
)
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