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
25806167
Commit
25806167
authored
Jun 29, 2018
by
Sam Beckham
Committed by
Phil Hughes
Jun 29, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds a test for the environment scope field
parent
615ed618
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
3 deletions
+45
-3
app/views/projects/clusters/user/_form.html.haml
app/views/projects/clusters/user/_form.html.haml
+4
-3
ee/spec/features/projects/clusters/gcp_spec.rb
ee/spec/features/projects/clusters/gcp_spec.rb
+28
-0
spec/features/projects/clusters/gcp_spec.rb
spec/features/projects/clusters/gcp_spec.rb
+13
-0
No files found.
app/views/projects/clusters/user/_form.html.haml
View file @
25806167
...
@@ -3,9 +3,10 @@
...
@@ -3,9 +3,10 @@
.form-group
.form-group
=
field
.
label
:name
,
s_
(
'ClusterIntegration|Kubernetes cluster name'
),
class:
'label-light'
=
field
.
label
:name
,
s_
(
'ClusterIntegration|Kubernetes cluster name'
),
class:
'label-light'
=
field
.
text_field
:name
,
class:
'form-control'
,
placeholder:
s_
(
'ClusterIntegration|Kubernetes cluster name'
)
=
field
.
text_field
:name
,
class:
'form-control'
,
placeholder:
s_
(
'ClusterIntegration|Kubernetes cluster name'
)
.form-group
-
if
has_multiple_clusters?
(
@project
)
=
field
.
label
:environment_scope
,
s_
(
'ClusterIntegration|Environment scope'
),
class:
'label-light'
.form-group
=
field
.
text_field
:environment_scope
,
class:
'form-control'
,
readonly:
!
has_multiple_clusters?
(
@project
),
placeholder:
s_
(
'ClusterIntegration|Environment scope'
)
=
field
.
label
:environment_scope
,
s_
(
'ClusterIntegration|Environment scope'
),
class:
'label-light'
=
field
.
text_field
:environment_scope
,
class:
'form-control'
,
placeholder:
s_
(
'ClusterIntegration|Environment scope'
)
=
field
.
fields_for
:platform_kubernetes
,
@cluster
.
platform_kubernetes
do
|
platform_kubernetes_field
|
=
field
.
fields_for
:platform_kubernetes
,
@cluster
.
platform_kubernetes
do
|
platform_kubernetes_field
|
.form-group
.form-group
...
...
ee/spec/features/projects/clusters/gcp_spec.rb
0 → 100644
View file @
25806167
require
'spec_helper'
feature
'Gcp Cluster'
,
:js
do
include
GoogleApi
::
CloudPlatformHelpers
let
(
:project
)
{
create
(
:project
)
}
let
(
:user
)
{
create
(
:user
)
}
before
do
project
.
add_master
(
user
)
gitlab_sign_in
(
user
)
allow
(
Projects
::
ClustersController
).
to
receive
(
:STATUS_POLLING_INTERVAL
)
{
100
}
end
context
'when a user has a licence to use multiple clusers'
do
before
do
stub_licensed_features
(
multiple_clusters:
true
)
visit
project_clusters_path
(
project
)
click_link
'Add Kubernetes cluster'
click_link
'Add an existing Kubernetes cluster'
end
it
'user sees the "Environment scope" field'
do
expect
(
page
).
to
have_css
(
'#cluster_environment_scope'
)
end
end
end
spec/features/projects/clusters/gcp_spec.rb
View file @
25806167
...
@@ -157,6 +157,19 @@ feature 'Gcp Cluster', :js do
...
@@ -157,6 +157,19 @@ feature 'Gcp Cluster', :js do
end
end
end
end
context
'when a user cannot edit the environment scope'
do
before
do
visit
project_clusters_path
(
project
)
click_link
'Add Kubernetes cluster'
click_link
'Add an existing Kubernetes cluster'
end
it
'user does not see the "Environment scope" field'
do
expect
(
page
).
not_to
have_css
(
'#cluster_environment_scope'
)
end
end
context
'when user has not dismissed GCP signup offer'
do
context
'when user has not dismissed GCP signup offer'
do
before
do
before
do
visit
project_clusters_path
(
project
)
visit
project_clusters_path
(
project
)
...
...
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