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
4dfa6409
Commit
4dfa6409
authored
Dec 18, 2017
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use sequence to reduce change lines
parent
fb281d22
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
8 deletions
+8
-8
spec/controllers/projects/clusters_controller_spec.rb
spec/controllers/projects/clusters_controller_spec.rb
+5
-6
spec/factories/clusters/clusters.rb
spec/factories/clusters/clusters.rb
+1
-0
spec/finders/clusters_finder_spec.rb
spec/finders/clusters_finder_spec.rb
+1
-1
spec/services/clusters/create_service_spec.rb
spec/services/clusters/create_service_spec.rb
+1
-1
No files found.
spec/controllers/projects/clusters_controller_spec.rb
View file @
4dfa6409
...
...
@@ -4,7 +4,7 @@ describe Projects::ClustersController do
include
AccessMatchersForController
include
GoogleApi
::
CloudPlatformHelpers
l
et
(
:project
)
{
create
(
:project
)
}
s
et
(
:project
)
{
create
(
:project
)
}
describe
'GET index'
do
describe
'functionality'
do
...
...
@@ -18,7 +18,7 @@ describe Projects::ClustersController do
context
'when project has one or more clusters'
do
let
(
:project
)
{
create
(
:project
)
}
let!
(
:enabled_cluster
)
{
create
(
:cluster
,
:provided_by_gcp
,
projects:
[
project
])
}
let!
(
:disabled_cluster
)
{
create
(
:cluster
,
:disabled
,
:provided_by_gcp
,
environment_scope:
'prod/*'
,
projects:
[
project
])
}
let!
(
:disabled_cluster
)
{
create
(
:cluster
,
:disabled
,
:provided_by_gcp
,
projects:
[
project
])
}
it
'lists available clusters'
do
go
...
...
@@ -32,8 +32,7 @@ describe Projects::ClustersController do
before
do
allow
(
Clusters
::
Cluster
).
to
receive
(
:paginates_per
).
and_return
(
1
)
create
(
:cluster
,
:provided_by_gcp
,
environment_scope:
'staging/*'
,
projects:
[
project
])
create
(
:cluster
,
:provided_by_gcp
,
environment_scope:
'review/*'
,
projects:
[
project
])
create_list
(
:cluster
,
2
,
:provided_by_gcp
,
projects:
[
project
])
get
:index
,
namespace_id:
project
.
namespace
,
project_id:
project
,
page:
last_page
end
...
...
@@ -287,7 +286,7 @@ describe Projects::ClustersController do
end
describe
'security'
do
l
et
(
:cluster
)
{
create
(
:cluster
,
:provided_by_gcp
,
projects:
[
project
])
}
s
et
(
:cluster
)
{
create
(
:cluster
,
:provided_by_gcp
,
projects:
[
project
])
}
let
(
:params
)
do
{
cluster:
{
enabled:
false
}
}
...
...
@@ -371,7 +370,7 @@ describe Projects::ClustersController do
end
describe
'security'
do
let
(
:cluster
)
{
create
(
:cluster
,
:provided_by_gcp
,
environment_scope:
'prod/*'
,
projects:
[
project
])
}
set
(
:cluster
)
{
create
(
:cluster
,
:provided_by_gcp
,
projects:
[
project
])
}
it
{
expect
{
go
}.
to
be_allowed_for
(
:admin
)
}
it
{
expect
{
go
}.
to
be_allowed_for
(
:owner
).
of
(
project
)
}
...
...
spec/factories/clusters/clusters.rb
View file @
4dfa6409
...
...
@@ -2,6 +2,7 @@ FactoryBot.define do
factory
:cluster
,
class:
Clusters
::
Cluster
do
user
name
'test-cluster'
sequence
(
:environment_scope
)
{
|
n
|
"production
#{
n
}
/*"
}
trait
:project
do
before
(
:create
)
do
|
cluster
,
evaluator
|
...
...
spec/finders/clusters_finder_spec.rb
View file @
4dfa6409
...
...
@@ -6,7 +6,7 @@ describe ClustersFinder do
describe
'#execute'
do
let
(
:enabled_cluster
)
{
create
(
:cluster
,
:provided_by_gcp
,
projects:
[
project
])
}
let
(
:disabled_cluster
)
{
create
(
:cluster
,
:disabled
,
:provided_by_gcp
,
environment_scope:
'prod/*'
,
projects:
[
project
])
}
let
(
:disabled_cluster
)
{
create
(
:cluster
,
:disabled
,
:provided_by_gcp
,
projects:
[
project
])
}
subject
{
described_class
.
new
(
project
,
user
,
scope
).
execute
}
...
...
spec/services/clusters/create_service_spec.rb
View file @
4dfa6409
...
...
@@ -81,7 +81,7 @@ describe Clusters::CreateService do
end
context
'when project has a cluster'
do
let!
(
:cluster
)
{
create
(
:cluster
,
:provided_by_gcp
,
environment_scope:
'prod/*'
,
projects:
[
project
])
}
let!
(
:cluster
)
{
create
(
:cluster
,
:provided_by_gcp
,
projects:
[
project
])
}
before
do
allow
(
project
).
to
receive
(
:feature_available?
).
and_call_original
...
...
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