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
f8b29b06
Commit
f8b29b06
authored
Dec 04, 2017
by
Alessio Caiazza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix static analysis
💚
parent
dc350a1c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
15 deletions
+15
-15
spec/controllers/projects/clusters/user_controller_spec.rb
spec/controllers/projects/clusters/user_controller_spec.rb
+1
-1
spec/controllers/projects/clusters_controller_spec.rb
spec/controllers/projects/clusters_controller_spec.rb
+9
-9
spec/features/projects/clusters/applications_spec.rb
spec/features/projects/clusters/applications_spec.rb
+1
-1
spec/features/projects/clusters/gcp_spec.rb
spec/features/projects/clusters/gcp_spec.rb
+4
-4
No files found.
spec/controllers/projects/clusters/user_controller_spec.rb
View file @
f8b29b06
...
...
@@ -58,7 +58,7 @@ describe Projects::Clusters::UserController do
project
.
add_master
(
user
)
sign_in
(
user
)
end
context
'when creates a cluster'
do
it
'creates a new cluster'
do
expect
(
ClusterProvisionWorker
).
to
receive
(
:perform_async
)
...
...
spec/controllers/projects/clusters_controller_spec.rb
View file @
f8b29b06
...
...
@@ -18,11 +18,11 @@ describe Projects::ClustersController do
context
'when project has a cluster'
do
let!
(
:cluster
)
{
create
(
:cluster
,
:provided_by_gcp
,
projects:
[
project
])
}
it
{
expect
(
go
).
to
redirect_to
(
namespace_project_cluster_path
(
project
.
namespace
,
project
,
project
.
cluster
))
}
it
{
expect
(
go
).
to
redirect_to
(
project_cluster_path
(
project
,
project
.
cluster
))
}
end
context
'when project does not have a cluster'
do
it
{
expect
(
go
).
to
redirect_to
(
new_
namespace_project_cluster_path
(
project
.
namespace
,
project
))
}
it
{
expect
(
go
).
to
redirect_to
(
new_
project_cluster_path
(
project
))
}
end
end
...
...
@@ -146,7 +146,7 @@ describe Projects::ClustersController do
go
cluster
.
reload
expect
(
response
).
to
redirect_to
(
namespace_project_cluster_path
(
project
.
namespace
,
project
,
project
.
cluster
))
expect
(
response
).
to
redirect_to
(
project_cluster_path
(
project
,
project
.
cluster
))
expect
(
flash
[
:notice
]).
to
eq
(
'Cluster was successfully updated.'
)
expect
(
cluster
.
enabled
).
to
be_falsey
end
...
...
@@ -197,7 +197,7 @@ describe Projects::ClustersController do
go
cluster
.
reload
expect
(
response
).
to
redirect_to
(
namespace_project_cluster_path
(
project
.
namespace
,
project
,
project
.
cluster
))
expect
(
response
).
to
redirect_to
(
project_cluster_path
(
project
,
project
.
cluster
))
expect
(
flash
[
:notice
]).
to
eq
(
'Cluster was successfully updated.'
)
expect
(
cluster
.
enabled
).
to
be_falsey
expect
(
cluster
.
name
).
to
eq
(
'my-new-cluster-name'
)
...
...
@@ -237,8 +237,8 @@ describe Projects::ClustersController do
def
go
put
:update
,
params
.
merge
(
namespace_id:
project
.
namespace
,
project_id:
project
,
id:
cluster
)
project_id:
project
,
id:
cluster
)
end
end
...
...
@@ -261,7 +261,7 @@ describe Projects::ClustersController do
.
and
change
{
Clusters
::
Platforms
::
Kubernetes
.
count
}.
by
(
-
1
)
.
and
change
{
Clusters
::
Providers
::
Gcp
.
count
}.
by
(
-
1
)
expect
(
response
).
to
redirect_to
(
namespace_project_clusters_path
(
project
.
namespace
,
project
))
expect
(
response
).
to
redirect_to
(
project_clusters_path
(
project
))
expect
(
flash
[
:notice
]).
to
eq
(
'Cluster integration was successfully removed.'
)
end
end
...
...
@@ -274,7 +274,7 @@ describe Projects::ClustersController do
.
to
change
{
Clusters
::
Cluster
.
count
}.
by
(
-
1
)
.
and
change
{
Clusters
::
Providers
::
Gcp
.
count
}.
by
(
-
1
)
expect
(
response
).
to
redirect_to
(
namespace_project_clusters_path
(
project
.
namespace
,
project
))
expect
(
response
).
to
redirect_to
(
project_clusters_path
(
project
))
expect
(
flash
[
:notice
]).
to
eq
(
'Cluster integration was successfully removed.'
)
end
end
...
...
@@ -290,7 +290,7 @@ describe Projects::ClustersController do
.
and
change
{
Clusters
::
Platforms
::
Kubernetes
.
count
}.
by
(
-
1
)
.
and
change
{
Clusters
::
Providers
::
Gcp
.
count
}.
by
(
0
)
expect
(
response
).
to
redirect_to
(
namespace_project_clusters_path
(
project
.
namespace
,
project
))
expect
(
response
).
to
redirect_to
(
project_clusters_path
(
project
))
expect
(
flash
[
:notice
]).
to
eq
(
'Cluster integration was successfully removed.'
)
end
end
...
...
spec/features/projects/clusters/applications_spec.rb
View file @
f8b29b06
...
...
@@ -18,7 +18,7 @@ feature 'Clusters Applications', :js do
context
'when cluster is being created'
do
let
(
:cluster
)
{
create
(
:cluster
,
:providing_by_gcp
,
projects:
[
project
])}
scenario
'user is unable to install applications'
do
page
.
within
(
'.js-cluster-application-row-helm'
)
do
expect
(
page
.
find
(
:css
,
'.js-cluster-application-install-button'
)[
'disabled'
]).
to
eq
(
'true'
)
...
...
spec/features/projects/clusters/gcp_spec.rb
View file @
f8b29b06
...
...
@@ -89,18 +89,18 @@ feature 'Gcp Cluster', :js do
page
.
find
(
:css
,
'.js-toggle-cluster'
).
click
click_button
'Save'
end
it
'user sees the successful message'
do
expect
(
page
).
to
have_content
(
'Cluster was successfully updated.'
)
end
end
context
'when user changes cluster parameters'
do
before
do
fill_in
'cluster_platform_kubernetes_attributes_namespace'
,
with:
'my-namespace'
click_button
'Save changes'
end
it
'user sees the successful message'
do
expect
(
page
).
to
have_content
(
'Cluster was successfully updated.'
)
expect
(
cluster
.
reload
.
platform_kubernetes
.
namespace
).
to
eq
(
'my-namespace'
)
...
...
@@ -113,7 +113,7 @@ feature 'Gcp Cluster', :js do
click_link
'Remove integration'
end
end
it
'user sees creation form with the successful message'
do
expect
(
page
).
to
have_content
(
'Cluster integration was successfully removed.'
)
expect
(
page
).
to
have_link
(
'Create on GKE'
)
...
...
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