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
cff66a0a
Commit
cff66a0a
authored
Dec 17, 2017
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor clusters feature spec
parent
c12d5a6c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
16 deletions
+24
-16
spec/ee/spec/features/projects/clusters_spec.rb
spec/ee/spec/features/projects/clusters_spec.rb
+24
-16
No files found.
spec/ee/spec/features/projects/clusters_spec.rb
View file @
cff66a0a
require
'spec_helper'
feature
'Clusters'
,
:js
do
include
GoogleApi
::
CloudPlatformHelpers
feature
'EE Clusters'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:user
)
{
create
(
:user
)
}
...
...
@@ -11,31 +9,41 @@ feature 'Clusters', :js do
gitlab_sign_in
(
user
)
end
context
'when user has a cluster and visits cluster index page'
do
let!
(
:cluster
)
{
create
(
:cluster
,
:project
,
:provided_by_gcp
)
}
let
(
:project
)
{
cluster
.
project
}
before
do
visit
project_clusters_path
(
project
)
end
context
'when user has a cluster'
do
let!
(
:cluster
)
{
create
(
:cluster
,
:provided_by_gcp
,
projects:
[
project
])
}
context
'when license has multiple clusters feature'
do
before
do
allow_any_instance_of
(
EE
::
Project
).
to
receive
(
:feature_available?
).
with
(
:multiple_clusters
).
and_return
(
true
)
allow
(
License
).
to
receive
(
:feature_available?
).
and_call_original
allow
(
License
).
to
receive
(
:feature_available?
).
with
(
:multiple_clusters
).
and_return
(
true
)
end
it
'user sees a add cluster button '
do
expect
(
page
).
to
have_selector
(
'.js-add-cluster'
)
context
'when user visits clusters page'
do
before
do
visit
project_clusters_path
(
project
)
end
it
'user sees a add cluster button '
do
expect
(
page
).
not_to
have_selector
(
'.js-add-cluster.disabled'
)
expect
(
page
).
to
have_selector
(
'.js-add-cluster'
)
end
end
end
context
'when license does not have multiple clusters feature'
do
before
do
allow_any_instance_of
(
EE
::
Project
).
to
receive
(
:feature_available?
).
with
(
:multiple_clusters
).
and_return
(
false
)
allow
(
License
).
to
receive
(
:feature_available?
).
and_call_original
allow
(
License
).
to
receive
(
:feature_available?
).
with
(
:multiple_clusters
).
and_return
(
false
)
end
it
'user sees a disabled add cluster button '
do
expect
(
page
).
to
have_selector
(
'.js-add-cluster.disabled'
)
context
'when user visits cluster index page'
do
before
do
visit
project_clusters_path
(
project
)
end
it
'user sees a disabled add cluster button '
do
expect
(
page
).
to
have_selector
(
'.js-add-cluster.disabled'
)
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