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
0e5c1a89
Commit
0e5c1a89
authored
May 01, 2018
by
Dylan Griffith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix spec/features/admin/admin_runners_spec.rb + test style improvements
parent
b7b82324
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
14 deletions
+20
-14
spec/controllers/projects/settings/ci_cd_controller_spec.rb
spec/controllers/projects/settings/ci_cd_controller_spec.rb
+13
-7
spec/features/admin/admin_runners_spec.rb
spec/features/admin/admin_runners_spec.rb
+3
-3
spec/models/ci/runner_spec.rb
spec/models/ci/runner_spec.rb
+4
-4
No files found.
spec/controllers/projects/settings/ci_cd_controller_spec.rb
View file @
0e5c1a89
...
...
@@ -18,15 +18,21 @@ describe Projects::Settings::CiCdController do
expect
(
response
).
to
render_template
(
:show
)
end
it
'sets assignable project runners'
do
group
=
create
(
:group
,
runners:
[
create
(
:ci_runner
)],
parent:
create
(
:group
))
group
.
add_master
(
user
)
project_runner
=
create
(
:ci_runner
,
projects:
[
create
(
:project
,
group:
group
)])
create
(
:ci_runner
,
:shared
)
context
'with group runners'
do
let
(
:group_runner
)
{
create
(
:ci_runner
)
}
let
(
:parent_group
)
{
create
(
:group
)
}
let
(
:group
)
{
create
(
:group
,
runners:
[
group_runner
],
parent:
parent_group
)
}
let
(
:other_project
)
{
create
(
:project
,
group:
group
)
}
let!
(
:project_runner
)
{
create
(
:ci_runner
,
projects:
[
other_project
])
}
let!
(
:shared_runner
)
{
create
(
:ci_runner
,
:shared
)
}
get
:show
,
namespace_id:
project
.
namespace
,
project_id:
project
it
'sets assignable project runners only'
do
group
.
add_master
(
user
)
get
:show
,
namespace_id:
project
.
namespace
,
project_id:
project
expect
(
assigns
(
:assignable_runners
)).
to
eq
[
project_runner
]
expect
(
assigns
(
:assignable_runners
)).
to
eq
[
project_runner
]
end
end
end
...
...
spec/features/admin/admin_runners_spec.rb
View file @
0e5c1a89
...
...
@@ -61,10 +61,10 @@ describe "Admin Runners" do
end
context
'group runner'
do
it
'shows the label and does not show the project count'
do
group
=
create
:group
runner
=
create
:ci_runner
,
groups:
[
group
]
let
(
:group
)
{
create
(
:group
)
}
let!
(
:runner
)
{
create
(
:ci_runner
,
groups:
[
group
],
runner_type: :group_type
)
}
it
'shows the label and does not show the project count'
do
visit
admin_runners_path
within
"#runner_
#{
runner
.
id
}
"
do
...
...
spec/models/ci/runner_spec.rb
View file @
0e5c1a89
...
...
@@ -21,8 +21,9 @@ describe Ci::Runner do
end
context
'either_projects_or_group'
do
let
(
:group
)
{
create
(
:group
)
}
it
'disallows assigning to a group if already assigned to a group'
do
group
=
create
(
:group
)
runner
=
create
(
:ci_runner
,
groups:
[
group
])
runner
.
groups
<<
build
(
:group
)
...
...
@@ -42,7 +43,6 @@ describe Ci::Runner do
end
it
'disallows assigning to a project if already assigned to a group'
do
group
=
create
(
:group
)
runner
=
create
(
:ci_runner
,
groups:
[
group
])
runner
.
projects
<<
build
(
:project
)
...
...
@@ -189,9 +189,9 @@ describe Ci::Runner do
# globally 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
contain_exactly
(
group_runner
,
project_runner
,
shared_runner
]
)
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