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
17eb78a9
Commit
17eb78a9
authored
Aug 22, 2017
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove CI API
parent
4d441dbc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
71 deletions
+0
-71
spec/ee/spec/lib/ee/ci/api/helpers_spec.rb
spec/ee/spec/lib/ee/ci/api/helpers_spec.rb
+0
-71
No files found.
spec/ee/spec/lib/ee/ci/api/helpers_spec.rb
deleted
100644 → 0
View file @
4d441dbc
require
'spec_helper'
describe
EE
::
Ci
::
API
::
Helpers
do
let
(
:helper
)
{
Class
.
new
{
include
Ci
::
API
::
Helpers
}.
new
}
before
do
allow
(
helper
).
to
receive
(
:env
).
and_return
({})
end
describe
'#authenticate_build'
do
let
(
:build
)
{
create
(
:ci_build
)
}
before
do
allow
(
helper
).
to
receive
(
:validate_build!
)
end
it
'handles sticking of a build when a build ID is specified'
do
allow
(
helper
).
to
receive
(
:params
).
and_return
(
id:
build
.
id
)
expect
(
Gitlab
::
Database
::
LoadBalancing
::
RackMiddleware
)
.
to
receive
(
:stick_or_unstick
)
.
with
({},
:build
,
build
.
id
)
helper
.
authenticate_build!
end
it
'does not handle sticking if no build ID was specified'
do
allow
(
helper
).
to
receive
(
:params
).
and_return
({})
expect
(
Gitlab
::
Database
::
LoadBalancing
::
RackMiddleware
)
.
not_to
receive
(
:stick_or_unstick
)
helper
.
authenticate_build!
end
it
'returns the build if one could be found'
do
allow
(
helper
).
to
receive
(
:params
).
and_return
(
id:
build
.
id
)
expect
(
helper
.
authenticate_build!
).
to
eq
(
build
)
end
end
describe
'#current_runner'
do
let
(
:runner
)
{
create
(
:ci_runner
,
token:
'foo'
)
}
it
'handles sticking of a runner if a token is specified'
do
allow
(
helper
).
to
receive
(
:params
).
and_return
(
token:
runner
.
token
)
expect
(
Gitlab
::
Database
::
LoadBalancing
::
RackMiddleware
)
.
to
receive
(
:stick_or_unstick
)
.
with
({},
:runner
,
runner
.
token
)
helper
.
current_runner
end
it
'does not handle sticking if no token was specified'
do
allow
(
helper
).
to
receive
(
:params
).
and_return
({})
expect
(
Gitlab
::
Database
::
LoadBalancing
::
RackMiddleware
)
.
not_to
receive
(
:stick_or_unstick
)
helper
.
current_runner
end
it
'returns the runner if one could be found'
do
allow
(
helper
).
to
receive
(
:params
).
and_return
(
token:
runner
.
token
)
expect
(
helper
.
current_runner
).
to
eq
(
runner
)
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