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
14c8dbc6
Commit
14c8dbc6
authored
Sep 06, 2017
by
Alexis Reigel
Committed by
Alexis Reigel
Apr 23, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drop 'scopes' context from specs
parent
40b0f540
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
45 deletions
+43
-45
spec/models/ci/runner_spec.rb
spec/models/ci/runner_spec.rb
+43
-45
No files found.
spec/models/ci/runner_spec.rb
View file @
14c8dbc6
...
@@ -49,64 +49,62 @@ describe Ci::Runner do
...
@@ -49,64 +49,62 @@ describe Ci::Runner do
end
end
end
end
describe
'scopes'
do
describe
'.owned_or_shared'
do
describe
'owned_or_shared'
do
it
'returns the specific project runner'
do
it
'returns the specific project runner'
do
# own
# own
specific_project
=
create
:project
specific_project
=
create
:project
specific_runner
=
create
:ci_runner
,
:specific
,
projects:
[
specific_project
]
specific_runner
=
create
:ci_runner
,
:specific
,
projects:
[
specific_project
]
# other
# other
other_project
=
create
:project
other_project
=
create
:project
create
:ci_runner
,
:specific
,
projects:
[
other_project
]
create
:ci_runner
,
:specific
,
projects:
[
other_project
]
expect
(
described_class
.
owned_or_shared
(
specific_project
.
id
)).
to
eq
[
specific_runner
]
expect
(
described_class
.
owned_or_shared
(
specific_project
.
id
)).
to
eq
[
specific_runner
]
end
end
it
'returns the shared project runner'
do
it
'returns the shared project runner'
do
project
=
create
:project
project
=
create
:project
runner
=
create
:ci_runner
,
:shared
,
projects:
[
project
]
runner
=
create
:ci_runner
,
:shared
,
projects:
[
project
]
expect
(
described_class
.
owned_or_shared
(
0
)).
to
eq
[
runner
]
expect
(
described_class
.
owned_or_shared
(
0
)).
to
eq
[
runner
]
end
end
it
'returns the specific group runner'
do
it
'returns the specific group runner'
do
# own
# own
specific_group
=
create
:group
specific_group
=
create
:group
specific_project
=
create
:project
,
group:
specific_group
specific_project
=
create
:project
,
group:
specific_group
specific_runner
=
create
:ci_runner
,
:specific
,
groups:
[
specific_group
]
specific_runner
=
create
:ci_runner
,
:specific
,
groups:
[
specific_group
]
# other
# other
other_group
=
create
:group
other_group
=
create
:group
create
:project
,
group:
other_group
create
:project
,
group:
other_group
create
:ci_runner
,
:specific
,
groups:
[
other_group
]
create
:ci_runner
,
:specific
,
groups:
[
other_group
]
expect
(
described_class
.
owned_or_shared
(
specific_project
.
id
)).
to
eq
[
specific_runner
]
expect
(
described_class
.
owned_or_shared
(
specific_project
.
id
)).
to
eq
[
specific_runner
]
end
end
it
'returns the shared group runner'
do
it
'returns the shared group runner'
do
group
=
create
:group
group
=
create
:group
runner
=
create
:ci_runner
,
:shared
,
groups:
[
group
]
runner
=
create
:ci_runner
,
:shared
,
groups:
[
group
]
expect
(
described_class
.
owned_or_shared
(
0
)).
to
eq
[
runner
]
expect
(
described_class
.
owned_or_shared
(
0
)).
to
eq
[
runner
]
end
end
it
'returns a globally shared, a project specific and a group specific runner'
do
it
'returns a globally shared, a project specific and a group specific runner'
do
# group specific
# group specific
group
=
create
:group
group
=
create
:group
project
=
create
:project
,
group:
group
project
=
create
:project
,
group:
group
group_runner
=
create
:ci_runner
,
:specific
,
groups:
[
group
]
group_runner
=
create
:ci_runner
,
:specific
,
groups:
[
group
]
# project specific
# project specific
project_runner
=
create
:ci_runner
,
:specific
,
projects:
[
project
]
project_runner
=
create
:ci_runner
,
:specific
,
projects:
[
project
]
# globally shared
# globally shared
shared_runner
=
create
:ci_runner
,
:shared
shared_runner
=
create
:ci_runner
,
:shared
expect
(
described_class
.
owned_or_shared
(
project
.
id
)).
to
match_array
[
expect
(
described_class
.
owned_or_shared
(
project
.
id
)).
to
match_array
[
group_runner
,
project_runner
,
shared_runner
group_runner
,
project_runner
,
shared_runner
]
]
end
end
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