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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
82523331
Commit
82523331
authored
May 06, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extend CI runners specs
parent
9fd6f1b6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
1 deletion
+31
-1
spec/models/ci/runner_spec.rb
spec/models/ci/runner_spec.rb
+31
-1
No files found.
spec/models/ci/runner_spec.rb
View file @
82523331
require
'spec_helper'
require
'spec_helper'
describe
Ci
::
Runner
,
models:
true
do
describe
Ci
::
Runner
,
models:
true
do
describe
'validation'
do
context
'when runner is not allowed to pick untagged jobs'
do
context
'when runner does not have tags'
do
it
'is not valid'
do
runner
=
build
(
:ci_runner
,
tag_list:
[],
run_untagged:
false
)
expect
(
runner
).
to
be_invalid
end
end
context
'when runner has tags'
do
it
'is valid'
do
runner
=
build
(
:ci_runner
,
tag_list:
[
'tag'
],
run_untagged:
false
)
expect
(
runner
).
to
be_valid
end
end
end
end
describe
'#display_name'
do
describe
'#display_name'
do
it
'should return the description if it has a value'
do
it
'should return the description if it has a value'
do
runner
=
FactoryGirl
.
build
(
:ci_runner
,
description:
'Linux/Ruby-1.9.3-p448'
)
runner
=
FactoryGirl
.
build
(
:ci_runner
,
description:
'Linux/Ruby-1.9.3-p448'
)
...
@@ -114,7 +132,19 @@ describe Ci::Runner, models: true do
...
@@ -114,7 +132,19 @@ describe Ci::Runner, models: true do
end
end
end
end
describe
'#search'
do
describe
'#has_tags?'
do
context
'when runner has tags'
do
subject
{
create
(
:ci_runner
,
tag_list:
[
'tag'
])
}
it
{
is_expected
.
to
have_tags
}
end
context
'when runner does not have tags'
do
subject
{
create
(
:ci_runner
,
tag_list:
[])
}
it
{
is_expected
.
to_not
have_tags
}
end
end
describe
'.search'
do
let
(
:runner
)
{
create
(
:ci_runner
,
token:
'123abc'
)
}
let
(
:runner
)
{
create
(
:ci_runner
,
token:
'123abc'
)
}
it
'returns runners with a matching token'
do
it
'returns runners with a matching token'
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