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
Léo-Paul Géneau
gitlab-ce
Commits
981b8ab7
Commit
981b8ab7
authored
May 22, 2018
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reduce CE/EE diff in app/controllers/projects/clusters_controller.rb
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
248cefc7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
18 deletions
+4
-18
app/controllers/projects/clusters_controller.rb
app/controllers/projects/clusters_controller.rb
+0
-13
spec/controllers/projects/clusters_controller_spec.rb
spec/controllers/projects/clusters_controller_spec.rb
+4
-5
No files found.
app/controllers/projects/clusters_controller.rb
View file @
981b8ab7
...
...
@@ -71,19 +71,6 @@ class Projects::ClustersController < Projects::ApplicationController
.
present
(
current_user:
current_user
)
end
def
create_params
params
.
require
(
:cluster
).
permit
(
:enabled
,
:name
,
:provider_type
,
provider_gcp_attributes:
[
:gcp_project_id
,
:zone
,
:num_nodes
,
:machine_type
])
end
def
update_params
if
cluster
.
managed?
params
.
require
(
:cluster
).
permit
(
...
...
spec/controllers/projects/clusters_controller_spec.rb
View file @
981b8ab7
...
...
@@ -2,7 +2,6 @@ require 'spec_helper'
describe
Projects
::
ClustersController
do
include
AccessMatchersForController
include
GoogleApi
::
CloudPlatformHelpers
set
(
:project
)
{
create
(
:project
)
}
...
...
@@ -333,7 +332,7 @@ describe Projects::ClustersController do
context
'when cluster is provided by GCP'
do
context
'when cluster is created'
do
let!
(
:cluster
)
{
create
(
:cluster
,
:provided_by_gcp
,
projects:
[
project
])
}
let!
(
:cluster
)
{
create
(
:cluster
,
:provided_by_gcp
,
:production_environment
,
projects:
[
project
])
}
it
"destroys and redirects back to clusters list"
do
expect
{
go
}
...
...
@@ -347,7 +346,7 @@ describe Projects::ClustersController do
end
context
'when cluster is being created'
do
let!
(
:cluster
)
{
create
(
:cluster
,
:providing_by_gcp
,
projects:
[
project
])
}
let!
(
:cluster
)
{
create
(
:cluster
,
:providing_by_gcp
,
:production_environment
,
projects:
[
project
])
}
it
"destroys and redirects back to clusters list"
do
expect
{
go
}
...
...
@@ -361,7 +360,7 @@ describe Projects::ClustersController do
end
context
'when cluster is provided by user'
do
let!
(
:cluster
)
{
create
(
:cluster
,
:provided_by_user
,
projects:
[
project
])
}
let!
(
:cluster
)
{
create
(
:cluster
,
:provided_by_user
,
:production_environment
,
projects:
[
project
])
}
it
"destroys and redirects back to clusters list"
do
expect
{
go
}
...
...
@@ -376,7 +375,7 @@ describe Projects::ClustersController do
end
describe
'security'
do
set
(
:cluster
)
{
create
(
:cluster
,
:provided_by_gcp
,
projects:
[
project
])
}
set
(
:cluster
)
{
create
(
:cluster
,
:provided_by_gcp
,
:production_environment
,
projects:
[
project
])
}
it
{
expect
{
go
}.
to
be_allowed_for
(
:admin
)
}
it
{
expect
{
go
}.
to
be_allowed_for
(
:owner
).
of
(
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