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
7a6ba30d
Commit
7a6ba30d
authored
May 31, 2016
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test token expirability
parent
7b0e2bbc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
container_registry_authentication_service_spec.rb
...es/auth/container_registry_authentication_service_spec.rb
+15
-0
No files found.
spec/services/auth/container_registry_authentication_service_spec.rb
View file @
7a6ba30d
...
...
@@ -17,6 +17,21 @@ describe Auth::ContainerRegistryAuthenticationService, services: true do
shared_examples
'a valid token'
do
it
{
is_expected
.
to
include
(
:token
)
}
it
{
expect
(
payload
).
to
include
(
'access'
)
}
context
'a expirable'
do
let
(
:expires_at
)
{
Time
.
at
(
payload
[
'exp'
])
}
let
(
:expire_delay
)
{
10
}
context
'for default configuration'
do
it
{
expect
(
expires_at
).
to_not
be_within
(
2
.
seconds
).
of
(
Time
.
now
+
expire_delay
.
minutes
)
}
end
context
'for changed configuration'
do
before
{
stub_application_setting
(
container_registry_token_expire_delay:
expire_delay
)
}
it
{
expect
(
expires_at
).
to
be_within
(
2
.
seconds
).
of
(
Time
.
now
+
expire_delay
.
minutes
)
}
end
end
end
shared_examples
'a accessible'
do
...
...
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