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
4b0e31ba
Commit
4b0e31ba
authored
Aug 28, 2017
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extend can_pick?
parent
6fbb3ce6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
0 deletions
+26
-0
runner.rb
app/models/ci/runner.rb
+2
-0
runner_spec.rb
spec/models/ci/runner_spec.rb
+24
-0
No files found.
app/models/ci/runner.rb
View file @
4b0e31ba
...
...
@@ -111,6 +111,8 @@ module Ci
end
def
can_pick?
(
build
)
return
false
if
self
.
protected_?
&&
!
build
.
protected?
assignable_for?
(
build
.
project
)
&&
accepting_tags?
(
build
)
end
...
...
spec/models/ci/runner_spec.rb
View file @
4b0e31ba
...
...
@@ -95,6 +95,8 @@ describe Ci::Runner do
let
(
:build
)
{
create
(
:ci_build
,
pipeline:
pipeline
)
}
let
(
:runner
)
{
create
(
:ci_runner
)
}
subject
{
runner
.
can_pick?
(
build
)
}
before
do
build
.
project
.
runners
<<
runner
end
...
...
@@ -222,6 +224,28 @@ describe Ci::Runner do
end
end
end
context
'when runner is protected'
do
before
do
runner
.
protected_!
end
context
'when build is protected'
do
before
do
build
.
protected
=
true
end
it
{
is_expected
.
to
be_truthy
}
end
context
'when build is unprotected'
do
before
do
build
.
protected
=
false
end
it
{
is_expected
.
to
be_falsey
}
end
end
end
describe
'#status'
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