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
...
@@ -1858,12 +1858,10 @@ describe User do
describe
'#ci_owned_runners'
do
describe
'#ci_owned_runners'
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
let!
(
:project
)
{
create
(
:project
)
}
let
(
:runner
)
{
create
(
:ci_runner
,
:project
,
projects:
[
project
])
}
let
(
:runner
)
{
create
(
:ci_runner
,
:project
,
projects:
[
project
])
}
context
'without any projects nor groups'
do
context
'without any projects nor groups'
do
let!
(
:project
)
{
create
(
:project
,
runners:
[
runner_1
])
}
let!
(
:group
)
{
create
(
:group
)
}
it
'does not load'
do
it
'does not load'
do
expect
(
user
.
ci_owned_runners
).
to
be_empty
expect
(
user
.
ci_owned_runners
).
to
be_empty
end
end
...
@@ -1871,38 +1869,40 @@ describe User do
...
@@ -1871,38 +1869,40 @@ describe User do
context
'with personal projects runners'
do
context
'with personal projects runners'
do
let
(
:namespace
)
{
create
(
:namespace
,
owner:
user
)
}
let
(
:namespace
)
{
create
(
:namespace
,
owner:
user
)
}
let!
(
:project
)
{
create
(
:project
,
namespace:
namespace
,
runners:
[
runner_1
]
)
}
let!
(
:project
)
{
create
(
:project
,
namespace:
namespace
)
}
it
'loads'
do
it
'loads'
do
expect
(
user
.
ci_owned_runners
).
to
contain_exactly
(
runner
_1
)
expect
(
user
.
ci_owned_runners
).
to
contain_exactly
(
runner
)
end
end
end
end
context
'with personal group runner'
do
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
let!
(
:group
)
do
create
(
:group
,
runners:
[
runner_2
]
).
tap
do
|
group
|
create
(
:group
).
tap
do
|
group
|
group
.
add_owner
(
user
)
group
.
add_owner
(
user
)
end
end
end
end
it
'loads'
do
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
end
end
context
'with personal project and group runner'
do
context
'with personal project and group runner'
do
let
(
:namespace
)
{
create
(
:namespace
,
owner:
user
)
}
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
let!
(
:group
)
do
create
(
:group
,
runners:
[
runner_2
]
).
tap
do
|
group
|
create
(
:group
).
tap
do
|
group
|
group
.
add_owner
(
user
)
group
.
add_owner
(
user
)
end
end
end
end
it
'loads'
do
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
end
end
...
@@ -1913,7 +1913,7 @@ describe User do
...
@@ -1913,7 +1913,7 @@ describe User do
end
end
it
'loads'
do
it
'loads'
do
expect
(
user
.
ci_owned_runners
).
to
contain_exactly
(
runner
_1
)
expect
(
user
.
ci_owned_runners
).
to
contain_exactly
(
runner
)
end
end
end
end
...
@@ -1930,7 +1930,7 @@ describe User do
...
@@ -1930,7 +1930,7 @@ describe User do
context
'with groups projects runners'
do
context
'with groups projects runners'
do
let
(
:group
)
{
create
(
:group
)
}
let
(
:group
)
{
create
(
:group
)
}
let!
(
:project
)
{
create
(
:project
,
group:
group
,
runners:
[
runner_1
]
)
}
let!
(
:project
)
{
create
(
:project
,
group:
group
)
}
def
add_user
(
access
)
def
add_user
(
access
)
group
.
add_user
(
user
,
access
)
group
.
add_user
(
user
,
access
)
...
@@ -1940,11 +1940,8 @@ describe User do
...
@@ -1940,11 +1940,8 @@ describe User do
end
end
context
'with groups runners'
do
context
'with groups runners'
do
let!
(
:group
)
do
let!
(
:runner
)
{
create
(
:ci_runner
,
:group
,
groups:
[
group
])
}
create
(
:group
,
runners:
[
runner_1
]).
tap
do
|
group
|
let!
(
:group
)
{
create
(
:group
)
}
group
.
add_owner
(
user
)
end
end
def
add_user
(
access
)
def
add_user
(
access
)
group
.
add_user
(
user
,
access
)
group
.
add_user
(
user
,
access
)
...
@@ -1954,7 +1951,7 @@ describe User do
...
@@ -1954,7 +1951,7 @@ describe User do
end
end
context
'with other projects runners'
do
context
'with other projects runners'
do
let!
(
:project
)
{
create
(
:project
,
runners:
[
runner_1
]
)
}
let!
(
:project
)
{
create
(
:project
)
}
def
add_user
(
access
)
def
add_user
(
access
)
project
.
add_role
(
user
,
access
)
project
.
add_role
(
user
,
access
)
...
@@ -1967,7 +1964,7 @@ describe User do
...
@@ -1967,7 +1964,7 @@ describe User do
let
(
:group
)
{
create
(
:group
)
}
let
(
:group
)
{
create
(
:group
)
}
let
(
:another_user
)
{
create
(
:user
)
}
let
(
:another_user
)
{
create
(
:user
)
}
let
(
:subgroup
)
{
create
(
:group
,
parent:
group
)
}
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
)
def
add_user
(
access
)
group
.
add_user
(
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