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
c4914b37
Commit
c4914b37
authored
Nov 13, 2020
by
Petar Prokic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix tests
- Fix broken test - Add enabled and managed to PUT tests
parent
583451ea
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
spec/requests/api/project_clusters_spec.rb
spec/requests/api/project_clusters_spec.rb
+11
-3
No files found.
spec/requests/api/project_clusters_spec.rb
View file @
c4914b37
...
@@ -88,8 +88,8 @@ RSpec.describe API::ProjectClusters do
...
@@ -88,8 +88,8 @@ RSpec.describe API::ProjectClusters do
expect
(
json_response
[
'environment_scope'
]).
to
eq
(
'*'
)
expect
(
json_response
[
'environment_scope'
]).
to
eq
(
'*'
)
expect
(
json_response
[
'cluster_type'
]).
to
eq
(
'project_type'
)
expect
(
json_response
[
'cluster_type'
]).
to
eq
(
'project_type'
)
expect
(
json_response
[
'domain'
]).
to
eq
(
'example.com'
)
expect
(
json_response
[
'domain'
]).
to
eq
(
'example.com'
)
expect
(
json_response
[
'enabled'
]).
to
eq
(
'true'
)
expect
(
json_response
[
'enabled'
]).
to
be_truthy
expect
(
json_response
[
'managed'
]).
to
eq
(
'true'
)
expect
(
json_response
[
'managed'
]).
to
be_truthy
end
end
it
'returns project information'
do
it
'returns project information'
do
...
@@ -173,6 +173,7 @@ RSpec.describe API::ProjectClusters do
...
@@ -173,6 +173,7 @@ RSpec.describe API::ProjectClusters do
name:
'test-cluster'
,
name:
'test-cluster'
,
domain:
'domain.example.com'
,
domain:
'domain.example.com'
,
managed:
false
,
managed:
false
,
enabled:
false
,
namespace_per_environment:
false
,
namespace_per_environment:
false
,
platform_kubernetes_attributes:
platform_kubernetes_attributes
,
platform_kubernetes_attributes:
platform_kubernetes_attributes
,
management_project_id:
management_project_id
management_project_id:
management_project_id
...
@@ -204,6 +205,7 @@ RSpec.describe API::ProjectClusters do
...
@@ -204,6 +205,7 @@ RSpec.describe API::ProjectClusters do
expect
(
cluster_result
.
name
).
to
eq
(
'test-cluster'
)
expect
(
cluster_result
.
name
).
to
eq
(
'test-cluster'
)
expect
(
cluster_result
.
domain
).
to
eq
(
'domain.example.com'
)
expect
(
cluster_result
.
domain
).
to
eq
(
'domain.example.com'
)
expect
(
cluster_result
.
managed
).
to
be_falsy
expect
(
cluster_result
.
managed
).
to
be_falsy
expect
(
cluster_result
.
enabled
).
to
be_falsy
expect
(
cluster_result
.
management_project_id
).
to
eq
management_project_id
expect
(
cluster_result
.
management_project_id
).
to
eq
management_project_id
expect
(
cluster_result
.
namespace_per_environment
).
to
eq
(
false
)
expect
(
cluster_result
.
namespace_per_environment
).
to
eq
(
false
)
expect
(
platform_kubernetes
.
rbac?
).
to
be_truthy
expect
(
platform_kubernetes
.
rbac?
).
to
be_truthy
...
@@ -339,7 +341,9 @@ RSpec.describe API::ProjectClusters do
...
@@ -339,7 +341,9 @@ RSpec.describe API::ProjectClusters do
{
{
domain:
'new-domain.com'
,
domain:
'new-domain.com'
,
platform_kubernetes_attributes:
platform_kubernetes_attributes
,
platform_kubernetes_attributes:
platform_kubernetes_attributes
,
management_project_id:
management_project_id
management_project_id:
management_project_id
,
managed:
false
,
enabled:
false
}
}
end
end
...
@@ -375,6 +379,8 @@ RSpec.describe API::ProjectClusters do
...
@@ -375,6 +379,8 @@ RSpec.describe API::ProjectClusters do
it
'updates cluster attributes'
do
it
'updates cluster attributes'
do
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
cluster
.
domain
).
to
eq
(
'new-domain.com'
)
expect
(
cluster
.
domain
).
to
eq
(
'new-domain.com'
)
expect
(
cluster
.
managed
).
to
be_falsy
expect
(
cluster
.
enabled
).
to
be_falsy
expect
(
cluster
.
platform_kubernetes
.
namespace
).
to
eq
(
'new-namespace'
)
expect
(
cluster
.
platform_kubernetes
.
namespace
).
to
eq
(
'new-namespace'
)
expect
(
cluster
.
management_project
).
to
eq
(
management_project
)
expect
(
cluster
.
management_project
).
to
eq
(
management_project
)
end
end
...
@@ -386,6 +392,8 @@ RSpec.describe API::ProjectClusters do
...
@@ -386,6 +392,8 @@ RSpec.describe API::ProjectClusters do
it
'does not update cluster attributes'
do
it
'does not update cluster attributes'
do
expect
(
response
).
to
have_gitlab_http_status
(
:bad_request
)
expect
(
response
).
to
have_gitlab_http_status
(
:bad_request
)
expect
(
cluster
.
domain
).
not_to
eq
(
'new_domain.com'
)
expect
(
cluster
.
domain
).
not_to
eq
(
'new_domain.com'
)
expect
(
cluster
.
managed
).
to
be_truthy
expect
(
cluster
.
enabled
).
to
be_truthy
expect
(
cluster
.
platform_kubernetes
.
namespace
).
not_to
eq
(
'invalid_namespace'
)
expect
(
cluster
.
platform_kubernetes
.
namespace
).
not_to
eq
(
'invalid_namespace'
)
expect
(
cluster
.
management_project
).
not_to
eq
(
management_project
)
expect
(
cluster
.
management_project
).
not_to
eq
(
management_project
)
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