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
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
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
2 deletions
+17
-2
spec/requests/ci/api/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
...
@@ -630,6 +630,7 @@ describe Ci::API::Builds do
context
'with an expire date'
do
context
'with an expire date'
do
let!
(
:artifacts
)
{
file_upload
}
let!
(
:artifacts
)
{
file_upload
}
let
(
:default_artifacts_expiration
)
{
0
}
let
(
:post_data
)
do
let
(
:post_data
)
do
{
'file.path'
=>
artifacts
.
path
,
{
'file.path'
=>
artifacts
.
path
,
...
@@ -638,7 +639,8 @@ describe Ci::API::Builds do
...
@@ -638,7 +639,8 @@ describe Ci::API::Builds do
end
end
before
do
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
)
post
(
post_url
,
post_data
,
headers_with_token
)
end
end
...
@@ -650,7 +652,8 @@ describe Ci::API::Builds do
...
@@ -650,7 +652,8 @@ describe Ci::API::Builds do
build
.
reload
build
.
reload
expect
(
response
).
to
have_http_status
(
201
)
expect
(
response
).
to
have_http_status
(
201
)
expect
(
json_response
[
'artifacts_expire_at'
]).
not_to
be_empty
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
end
end
...
@@ -663,6 +666,18 @@ describe Ci::API::Builds do
...
@@ -663,6 +666,18 @@ describe Ci::API::Builds do
expect
(
json_response
[
'artifacts_expire_at'
]).
to
be_nil
expect
(
json_response
[
'artifacts_expire_at'
]).
to
be_nil
expect
(
build
.
artifacts_expire_at
).
to
be_nil
expect
(
build
.
artifacts_expire_at
).
to
be_nil
end
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
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