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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
38759832
Commit
38759832
authored
Aug 28, 2017
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Impprove spec by godfat suggestions
parent
4b0e31ba
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
4 deletions
+13
-4
spec/factories/ci/runners.rb
spec/factories/ci/runners.rb
+2
-2
spec/lib/gitlab/ci/stage/seed_spec.rb
spec/lib/gitlab/ci/stage/seed_spec.rb
+10
-1
spec/requests/api/runners_spec.rb
spec/requests/api/runners_spec.rb
+1
-1
No files found.
spec/factories/ci/runners.rb
View file @
38759832
...
@@ -23,11 +23,11 @@ FactoryGirl.define do
...
@@ -23,11 +23,11 @@ FactoryGirl.define do
end
end
trait
:protected
do
trait
:protected
do
access_level
Ci
::
Runner
.
access_levels
[
'protected_'
]
access_level
'protected_'
end
end
trait
:unprotected
do
trait
:unprotected
do
access_level
Ci
::
Runner
.
access_levels
[
'unprotected'
]
access_level
'unprotected'
end
end
end
end
end
end
spec/lib/gitlab/ci/stage/seed_spec.rb
View file @
38759832
...
@@ -26,8 +26,17 @@ describe Gitlab::Ci::Stage::Seed do
...
@@ -26,8 +26,17 @@ describe Gitlab::Ci::Stage::Seed do
expect
(
subject
.
builds
).
to
all
(
include
(
project:
pipeline
.
project
))
expect
(
subject
.
builds
).
to
all
(
include
(
project:
pipeline
.
project
))
expect
(
subject
.
builds
)
expect
(
subject
.
builds
)
.
to
all
(
include
(
trigger_request:
pipeline
.
trigger_requests
.
first
))
.
to
all
(
include
(
trigger_request:
pipeline
.
trigger_requests
.
first
))
end
context
'when a ref is protected'
do
before
do
allow_any_instance_of
(
Project
).
to
receive
(
:protected_for?
).
and_return
(
true
)
end
it
'returns unprotected builds'
do
expect
(
subject
.
builds
).
to
all
(
include
(
protected:
true
))
expect
(
subject
.
builds
).
to
all
(
include
(
protected:
true
))
end
end
end
context
'when a ref is unprotected'
do
context
'when a ref is unprotected'
do
before
do
before
do
...
...
spec/requests/api/runners_spec.rb
View file @
38759832
...
@@ -192,7 +192,7 @@ describe API::Runners do
...
@@ -192,7 +192,7 @@ describe API::Runners do
tag_list:
[
'ruby2.1'
,
'pgsql'
,
'mysql'
],
tag_list:
[
'ruby2.1'
,
'pgsql'
,
'mysql'
],
run_untagged:
'false'
,
run_untagged:
'false'
,
locked:
'true'
,
locked:
'true'
,
access_level:
1
)
access_level:
Ci
::
Runner
.
access_levels
[
'protected_'
]
)
shared_runner
.
reload
shared_runner
.
reload
expect
(
response
).
to
have_http_status
(
200
)
expect
(
response
).
to
have_http_status
(
200
)
...
...
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