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
959fe9d5
Commit
959fe9d5
authored
Dec 17, 2017
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add environment scope validation feature spec
parent
cff66a0a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
0 deletions
+28
-0
spec/ee/spec/features/projects/clusters_spec.rb
spec/ee/spec/features/projects/clusters_spec.rb
+28
-0
No files found.
spec/ee/spec/features/projects/clusters_spec.rb
View file @
959fe9d5
...
...
@@ -27,6 +27,34 @@ feature 'EE Clusters' do
expect
(
page
).
not_to
have_selector
(
'.js-add-cluster.disabled'
)
expect
(
page
).
to
have_selector
(
'.js-add-cluster'
)
end
context
'when user tries to create a cluster with a duplicate environment scope'
do
before
do
allow_any_instance_of
(
Projects
::
Clusters
::
GcpController
)
.
to
receive
(
:token_in_session
).
and_return
(
'token'
)
allow_any_instance_of
(
Projects
::
Clusters
::
GcpController
)
.
to
receive
(
:expires_at_in_session
).
and_return
(
1
.
hour
.
since
.
to_i
.
to_s
)
allow_any_instance_of
(
GoogleApi
::
CloudPlatform
::
Client
)
.
to
receive
(
:projects_zones_clusters_create
)
do
OpenStruct
.
new
(
self_link:
'projects/gcp-project-12345/zones/us-central1-a/operations/ope-123'
,
status:
'RUNNING'
)
end
allow
(
WaitForClusterCreationWorker
).
to
receive
(
:perform_in
).
and_return
(
nil
)
click_link
'Add cluster'
click_link
'Create on GKE'
end
it
'users sees an error'
do
fill_in
'cluster_provider_gcp_attributes_gcp_project_id'
,
with:
'gcp-project-123'
fill_in
'cluster_name'
,
with:
'dev-cluster'
fill_in
'cluster_environment_scope'
,
with:
cluster
.
environment_scope
click_button
'Create cluster'
expect
(
page
).
to
have_css
(
'#error_explanation'
)
end
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