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
5f8dc660
Commit
5f8dc660
authored
Dec 07, 2017
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove cad9b671d134badf3aa6368d8e0430edc25a8806 (clusters_helper)
parent
eef96832
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
55 deletions
+0
-55
ee/app/helpers/clusters_helper.rb
ee/app/helpers/clusters_helper.rb
+0
-7
spec/ee/spec/helpers/clusters_helper_spec.rb
spec/ee/spec/helpers/clusters_helper_spec.rb
+0
-48
No files found.
ee/app/helpers/clusters_helper.rb
deleted
100644 → 0
View file @
eef96832
module
ClustersHelper
def
enable_add_cluster_button?
(
project
)
return
true
if
project
.
clusters
.
empty?
project
.
feature_available?
(
:multiple_clusters
)
end
end
spec/ee/spec/helpers/clusters_helper_spec.rb
deleted
100644 → 0
View file @
eef96832
require
'spec_helper'
describe
ClustersHelper
do
include
ApplicationHelper
describe
'.enable_add_cluster_button?'
do
set
(
:project
)
{
create
(
:project
)
}
set
(
:user
)
{
create
(
:user
)
}
subject
{
helper
.
enable_add_cluster_button?
(
project
)
}
context
'when project does not have a cluster'
do
it
{
is_expected
.
to
eq
(
true
)
}
end
context
'when project has a cluster'
do
before
do
params
=
{
name:
'test-cluster'
,
provider_type: :gcp
,
provider_gcp_attributes:
{
gcp_project_id:
'gcp-project'
,
zone:
'us-central1-a'
,
num_nodes:
1
,
machine_type:
'machine_type-a'
}
}
Clusters
::
Cluster
.
create
(
params
.
merge
(
user:
user
,
projects:
[
project
]))
end
context
'when project has multiple clusters available'
do
before
do
allow
(
project
).
to
receive
(
:feature_available?
).
with
(
:multiple_clusters
).
and_return
(
true
)
end
it
{
is_expected
.
to
eq
(
true
)
}
end
context
'when project does not have multiple clusters available'
do
before
do
allow
(
project
).
to
receive
(
:feature_available?
).
with
(
:multiple_clusters
).
and_return
(
false
)
end
it
{
is_expected
.
to
eq
(
false
)
}
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