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
bbd4cd11
Commit
bbd4cd11
authored
May 27, 2018
by
Dylan Griffith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix spec for User#ci_owned_runners
parent
ec614728
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
20 deletions
+17
-20
user_spec.rb
spec/models/user_spec.rb
+17
-20
No files found.
spec/models/user_spec.rb
View file @
bbd4cd11
...
...
@@ -1858,12 +1858,10 @@ describe User do
describe
'#ci_owned_runners'
do
let
(
:user
)
{
create
(
:user
)
}
let!
(
:project
)
{
create
(
:project
)
}
let
(
:runner
)
{
create
(
:ci_runner
,
:project
,
projects:
[
project
])
}
context
'without any projects nor groups'
do
let!
(
:project
)
{
create
(
:project
,
runners:
[
runner_1
])
}
let!
(
:group
)
{
create
(
:group
)
}
it
'does not load'
do
expect
(
user
.
ci_owned_runners
).
to
be_empty
end
...
...
@@ -1871,38 +1869,40 @@ describe User do
context
'with personal projects runners'
do
let
(
:namespace
)
{
create
(
:namespace
,
owner:
user
)
}
let!
(
:project
)
{
create
(
:project
,
namespace:
namespace
,
runners:
[
runner_1
]
)
}
let!
(
:project
)
{
create
(
:project
,
namespace:
namespace
)
}
it
'loads'
do
expect
(
user
.
ci_owned_runners
).
to
contain_exactly
(
runner
_1
)
expect
(
user
.
ci_owned_runners
).
to
contain_exactly
(
runner
)
end
end
context
'with personal group runner'
do
let!
(
:project
)
{
create
(
:project
,
runners:
[
runner_1
])
}
let!
(
:project
)
{
create
(
:project
)
}
let
(
:group_runner
)
{
create
(
:ci_runner
,
:group
,
groups:
[
group
])
}
let!
(
:group
)
do
create
(
:group
,
runners:
[
runner_2
]
).
tap
do
|
group
|
create
(
:group
).
tap
do
|
group
|
group
.
add_owner
(
user
)
end
end
it
'loads'
do
expect
(
user
.
ci_owned_runners
).
to
contain_exactly
(
runner_2
)
expect
(
user
.
ci_owned_runners
).
to
contain_exactly
(
group_runner
)
end
end
context
'with personal project and group runner'
do
let
(
:namespace
)
{
create
(
:namespace
,
owner:
user
)
}
let!
(
:project
)
{
create
(
:project
,
namespace:
namespace
,
runners:
[
runner_1
])
}
let!
(
:project
)
{
create
(
:project
,
namespace:
namespace
)
}
let!
(
:group_runner
)
{
create
(
:ci_runner
,
:group
,
groups:
[
group
])
}
let!
(
:group
)
do
create
(
:group
,
runners:
[
runner_2
]
).
tap
do
|
group
|
create
(
:group
).
tap
do
|
group
|
group
.
add_owner
(
user
)
end
end
it
'loads'
do
expect
(
user
.
ci_owned_runners
).
to
contain_exactly
(
runner
_1
,
runner_2
)
expect
(
user
.
ci_owned_runners
).
to
contain_exactly
(
runner
,
group_runner
)
end
end
...
...
@@ -1913,7 +1913,7 @@ describe User do
end
it
'loads'
do
expect
(
user
.
ci_owned_runners
).
to
contain_exactly
(
runner
_1
)
expect
(
user
.
ci_owned_runners
).
to
contain_exactly
(
runner
)
end
end
...
...
@@ -1930,7 +1930,7 @@ describe User do
context
'with groups projects runners'
do
let
(
:group
)
{
create
(
:group
)
}
let!
(
:project
)
{
create
(
:project
,
group:
group
,
runners:
[
runner_1
]
)
}
let!
(
:project
)
{
create
(
:project
,
group:
group
)
}
def
add_user
(
access
)
group
.
add_user
(
user
,
access
)
...
...
@@ -1940,11 +1940,8 @@ describe User do
end
context
'with groups runners'
do
let!
(
:group
)
do
create
(
:group
,
runners:
[
runner_1
]).
tap
do
|
group
|
group
.
add_owner
(
user
)
end
end
let!
(
:runner
)
{
create
(
:ci_runner
,
:group
,
groups:
[
group
])
}
let!
(
:group
)
{
create
(
:group
)
}
def
add_user
(
access
)
group
.
add_user
(
user
,
access
)
...
...
@@ -1954,7 +1951,7 @@ describe User do
end
context
'with other projects runners'
do
let!
(
:project
)
{
create
(
:project
,
runners:
[
runner_1
]
)
}
let!
(
:project
)
{
create
(
:project
)
}
def
add_user
(
access
)
project
.
add_role
(
user
,
access
)
...
...
@@ -1967,7 +1964,7 @@ describe User do
let
(
:group
)
{
create
(
:group
)
}
let
(
:another_user
)
{
create
(
:user
)
}
let
(
:subgroup
)
{
create
(
:group
,
parent:
group
)
}
let!
(
:project
)
{
create
(
:project
,
group:
subgroup
,
runners:
[
runner_1
]
)
}
let!
(
:project
)
{
create
(
:project
,
group:
subgroup
)
}
def
add_user
(
access
)
group
.
add_user
(
user
,
access
)
...
...
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