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
f2727bab
Commit
f2727bab
authored
Nov 27, 2017
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add specs for cluster counters
parent
aec7bbf1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
3 deletions
+21
-3
spec/controllers/projects/clusters_controller_spec.rb
spec/controllers/projects/clusters_controller_spec.rb
+21
-3
No files found.
spec/controllers/projects/clusters_controller_spec.rb
View file @
f2727bab
...
...
@@ -14,15 +14,26 @@ describe Projects::ClustersController do
end
context
'when project has one or more clusters'
do
let
(
:cluster
)
{
create
(
:cluster
,
:project
,
:provided_by_gcp
)
}
let
(
:project
)
{
cluster
.
project
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:clusters
)
{
create_list
(
:cluster
,
2
,
:provided_by_gcp
,
projects:
[
project
])
}
before
do
clusters
.
last
.
enabled
=
false
end
it
'lists available clusters'
do
go
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
response
).
to
render_template
(
:index
)
expect
(
assigns
(
:clusters
)).
to
eq
([
cluster
])
expect
(
assigns
(
:clusters
)).
to
eq
(
clusters
)
end
it
'assigns counters to correct values'
do
go
expect
(
assigns
(
:active_count
)).
to
eq
(
project
.
clusters
.
enabled
.
count
)
expect
(
assigns
(
:inactive_count
)).
to
eq
(
project
.
clusters
.
disabled
.
count
)
end
end
...
...
@@ -36,6 +47,13 @@ describe Projects::ClustersController do
expect
(
response
).
to
render_template
(
:index
)
expect
(
assigns
(
:clusters
)).
to
eq
([])
end
it
'assigns counters to zero'
do
go
expect
(
assigns
(
:active_count
)).
to
eq
(
0
)
expect
(
assigns
(
:inactive_count
)).
to
eq
(
0
)
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