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
Boxiang Sun
gitlab-ce
Commits
d1ba15c7
Commit
d1ba15c7
authored
Nov 27, 2017
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add specs for ClustersFinder
parent
554bf24b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
0 deletions
+33
-0
spec/finders/clusters_finder_spec.rb
spec/finders/clusters_finder_spec.rb
+33
-0
No files found.
spec/finders/clusters_finder_spec.rb
0 → 100644
View file @
d1ba15c7
require
'spec_helper'
describe
ClustersFinder
do
let
(
:project
)
{
create
(
:project
)
}
set
(
:user
)
{
create
(
:user
)
}
describe
'#execute'
do
before
do
create_list
(
:cluster
,
2
,
:provided_by_gcp
,
projects:
[
project
])
project
.
clusters
.
last
.
enabled
=
false
end
subject
{
described_class
.
new
(
project
,
user
,
scope
).
execute
}
context
'when scope is all'
do
let
(
:scope
)
{
:all
}
it
{
is_expected
.
to
eq
(
project
.
clusters
.
to_a
)
}
end
context
'when scope is enabled'
do
let
(
:scope
)
{
:enabled
}
it
{
is_expected
.
to
eq
(
project
.
clusters
.
enabled
.
to_a
)
}
end
context
'when scope is disabled'
do
let
(
:scope
)
{
:disabled
}
it
{
is_expected
.
to
eq
(
project
.
clusters
.
disabled
.
to_a
)
}
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