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
4e2644ce
Commit
4e2644ce
authored
Mar 22, 2018
by
Mayra Cabrera
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix broken specs given deployment_platform changes
parent
45201f79
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
14 additions
and
11 deletions
+14
-11
ee/spec/features/projects/show_project_spec.rb
ee/spec/features/projects/show_project_spec.rb
+1
-1
spec/controllers/projects/clusters_controller_spec.rb
spec/controllers/projects/clusters_controller_spec.rb
+6
-6
spec/factories/clusters/clusters.rb
spec/factories/clusters/clusters.rb
+4
-1
spec/finders/clusters_finder_spec.rb
spec/finders/clusters_finder_spec.rb
+1
-1
spec/presenters/project_presenter_spec.rb
spec/presenters/project_presenter_spec.rb
+1
-1
spec/services/clusters/create_service_spec.rb
spec/services/clusters/create_service_spec.rb
+1
-1
No files found.
ee/spec/features/projects/show_project_spec.rb
View file @
4e2644ce
...
@@ -17,7 +17,7 @@ describe 'Project show page', :feature do
...
@@ -17,7 +17,7 @@ describe 'Project show page', :feature do
it
'"Kubernetes cluster" button linked to clusters page'
do
it
'"Kubernetes cluster" button linked to clusters page'
do
create
(
:cluster
,
:provided_by_gcp
,
projects:
[
project
])
create
(
:cluster
,
:provided_by_gcp
,
projects:
[
project
])
create
(
:cluster
,
:provided_by_gcp
,
projects:
[
project
])
create
(
:cluster
,
:provided_by_gcp
,
:production_environment
,
projects:
[
project
])
visit
project_path
(
project
)
visit
project_path
(
project
)
...
...
spec/controllers/projects/clusters_controller_spec.rb
View file @
4e2644ce
...
@@ -18,7 +18,7 @@ describe Projects::ClustersController do
...
@@ -18,7 +18,7 @@ describe Projects::ClustersController do
context
'when project has one or more clusters'
do
context
'when project has one or more clusters'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:project
)
{
create
(
:project
)
}
let!
(
:enabled_cluster
)
{
create
(
:cluster
,
:provided_by_gcp
,
projects:
[
project
])
}
let!
(
:enabled_cluster
)
{
create
(
:cluster
,
:provided_by_gcp
,
projects:
[
project
])
}
let!
(
:disabled_cluster
)
{
create
(
:cluster
,
:disabled
,
:provided_by_gcp
,
projects:
[
project
])
}
let!
(
:disabled_cluster
)
{
create
(
:cluster
,
:disabled
,
:provided_by_gcp
,
:production_environment
,
projects:
[
project
])
}
it
'lists available clusters'
do
it
'lists available clusters'
do
go
go
...
@@ -32,7 +32,7 @@ describe Projects::ClustersController do
...
@@ -32,7 +32,7 @@ describe Projects::ClustersController do
before
do
before
do
allow
(
Clusters
::
Cluster
).
to
receive
(
:paginates_per
).
and_return
(
1
)
allow
(
Clusters
::
Cluster
).
to
receive
(
:paginates_per
).
and_return
(
1
)
create_list
(
:cluster
,
2
,
:provided_by_gcp
,
projects:
[
project
])
create_list
(
:cluster
,
2
,
:provided_by_gcp
,
:production_environment
,
projects:
[
project
])
get
:index
,
namespace_id:
project
.
namespace
,
project_id:
project
,
page:
last_page
get
:index
,
namespace_id:
project
.
namespace
,
project_id:
project
,
page:
last_page
end
end
...
@@ -420,7 +420,7 @@ describe Projects::ClustersController do
...
@@ -420,7 +420,7 @@ describe Projects::ClustersController do
context
'when cluster is provided by GCP'
do
context
'when cluster is provided by GCP'
do
context
'when cluster is created'
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
it
"destroys and redirects back to clusters list"
do
expect
{
go
}
expect
{
go
}
...
@@ -434,7 +434,7 @@ describe Projects::ClustersController do
...
@@ -434,7 +434,7 @@ describe Projects::ClustersController do
end
end
context
'when cluster is being created'
do
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
it
"destroys and redirects back to clusters list"
do
expect
{
go
}
expect
{
go
}
...
@@ -448,7 +448,7 @@ describe Projects::ClustersController do
...
@@ -448,7 +448,7 @@ describe Projects::ClustersController do
end
end
context
'when cluster is provided by user'
do
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
it
"destroys and redirects back to clusters list"
do
expect
{
go
}
expect
{
go
}
...
@@ -463,7 +463,7 @@ describe Projects::ClustersController do
...
@@ -463,7 +463,7 @@ describe Projects::ClustersController do
end
end
describe
'security'
do
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
(
:admin
)
}
it
{
expect
{
go
}.
to
be_allowed_for
(
:owner
).
of
(
project
)
}
it
{
expect
{
go
}.
to
be_allowed_for
(
:owner
).
of
(
project
)
}
...
...
spec/factories/clusters/clusters.rb
View file @
4e2644ce
...
@@ -2,7 +2,6 @@ FactoryBot.define do
...
@@ -2,7 +2,6 @@ FactoryBot.define do
factory
:cluster
,
class:
Clusters
::
Cluster
do
factory
:cluster
,
class:
Clusters
::
Cluster
do
user
user
name
'test-cluster'
name
'test-cluster'
environment_scope
Clusters
::
Cluster
::
DEFAULT_ENVIRONMENT
trait
:project
do
trait
:project
do
before
(
:create
)
do
|
cluster
,
evaluator
|
before
(
:create
)
do
|
cluster
,
evaluator
|
...
@@ -33,5 +32,9 @@ FactoryBot.define do
...
@@ -33,5 +32,9 @@ FactoryBot.define do
trait
:disabled
do
trait
:disabled
do
enabled
false
enabled
false
end
end
trait
:production_environment
do
sequence
(
:environment_scope
)
{
|
n
|
"production
#{
n
}
/*"
}
end
end
end
end
end
spec/finders/clusters_finder_spec.rb
View file @
4e2644ce
...
@@ -6,7 +6,7 @@ describe ClustersFinder do
...
@@ -6,7 +6,7 @@ describe ClustersFinder do
describe
'#execute'
do
describe
'#execute'
do
let
(
:enabled_cluster
)
{
create
(
:cluster
,
:provided_by_gcp
,
projects:
[
project
])
}
let
(
:enabled_cluster
)
{
create
(
:cluster
,
:provided_by_gcp
,
projects:
[
project
])
}
let
(
:disabled_cluster
)
{
create
(
:cluster
,
:disabled
,
:provided_by_gcp
,
projects:
[
project
])
}
let
(
:disabled_cluster
)
{
create
(
:cluster
,
:disabled
,
:provided_by_gcp
,
:production_environment
,
projects:
[
project
])
}
subject
{
described_class
.
new
(
project
,
user
,
scope
).
execute
}
subject
{
described_class
.
new
(
project
,
user
,
scope
).
execute
}
...
...
spec/presenters/project_presenter_spec.rb
View file @
4e2644ce
...
@@ -339,7 +339,7 @@ describe ProjectPresenter do
...
@@ -339,7 +339,7 @@ describe ProjectPresenter do
it
'returns link to clusters page if more than one exists'
do
it
'returns link to clusters page if more than one exists'
do
project
.
add_master
(
user
)
project
.
add_master
(
user
)
create
(
:cluster
,
projects:
[
project
])
create
(
:cluster
,
:production_environment
,
projects:
[
project
])
create
(
:cluster
,
projects:
[
project
])
create
(
:cluster
,
projects:
[
project
])
expect
(
presenter
.
kubernetes_cluster_anchor_data
).
to
eq
(
OpenStruct
.
new
(
enabled:
true
,
expect
(
presenter
.
kubernetes_cluster_anchor_data
).
to
eq
(
OpenStruct
.
new
(
enabled:
true
,
...
...
spec/services/clusters/create_service_spec.rb
View file @
4e2644ce
...
@@ -81,7 +81,7 @@ describe Clusters::CreateService do
...
@@ -81,7 +81,7 @@ describe Clusters::CreateService do
end
end
context
'when project has a cluster'
do
context
'when project has a cluster'
do
let!
(
:cluster
)
{
create
(
:cluster
,
:provided_by_gcp
,
projects:
[
project
])
}
let!
(
:cluster
)
{
create
(
:cluster
,
:provided_by_gcp
,
:production_environment
,
projects:
[
project
])
}
before
do
before
do
allow
(
project
).
to
receive
(
:feature_available?
).
and_call_original
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