Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/requests/api/project_clusters_spec.rb')
-rw-r--r--spec/requests/api/project_clusters_spec.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/requests/api/project_clusters_spec.rb b/spec/requests/api/project_clusters_spec.rb
index b83b41a881a..4c7da78f0d4 100644
--- a/spec/requests/api/project_clusters_spec.rb
+++ b/spec/requests/api/project_clusters_spec.rb
@@ -24,6 +24,10 @@ RSpec.describe API::ProjectClusters do
projects: [project])
end
+ include_examples ':certificate_based_clusters feature flag API responses' do
+ let(:subject) { get api("/projects/#{project.id}/clusters", developer_user) }
+ end
+
context 'non-authorized user' do
it 'responds with 403' do
get api("/projects/#{project.id}/clusters", reporter_user)
@@ -67,6 +71,10 @@ RSpec.describe API::ProjectClusters do
projects: [project])
end
+ include_examples ':certificate_based_clusters feature flag API responses' do
+ let(:subject) { get api("/projects/#{project.id}/clusters/#{cluster_id}", developer_user) }
+ end
+
context 'non-authorized user' do
it 'responds with 403' do
get api("/projects/#{project.id}/clusters/#{cluster_id}", reporter_user)
@@ -182,6 +190,10 @@ RSpec.describe API::ProjectClusters do
}
end
+ include_examples ':certificate_based_clusters feature flag API responses' do
+ let(:subject) { post api("/projects/#{project.id}/clusters/user", maintainer_user), params: cluster_params }
+ end
+
context 'non-authorized user' do
it 'responds with 403' do
post api("/projects/#{project.id}/clusters/user", developer_user), params: cluster_params
@@ -361,6 +373,10 @@ RSpec.describe API::ProjectClusters do
projects: [project])
end
+ include_examples ':certificate_based_clusters feature flag API responses' do
+ let(:subject) { put api("/projects/#{project.id}/clusters/#{cluster.id}", maintainer_user), params: update_params }
+ end
+
context 'non-authorized user' do
it 'responds with 403' do
put api("/projects/#{project.id}/clusters/#{cluster.id}", developer_user), params: update_params
@@ -493,6 +509,10 @@ RSpec.describe API::ProjectClusters do
projects: [project])
end
+ include_examples ':certificate_based_clusters feature flag API responses' do
+ let(:subject) { delete api("/projects/#{project.id}/clusters/#{cluster.id}", maintainer_user), params: cluster_params }
+ end
+
context 'non-authorized user' do
it 'responds with 403' do
delete api("/projects/#{project.id}/clusters/#{cluster.id}", developer_user), params: cluster_params