diff options
Diffstat (limited to 'spec/support/shared_examples/controllers/clusters_controller_shared_examples.rb')
-rw-r--r-- | spec/support/shared_examples/controllers/clusters_controller_shared_examples.rb | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/spec/support/shared_examples/controllers/clusters_controller_shared_examples.rb b/spec/support/shared_examples/controllers/clusters_controller_shared_examples.rb index aa17e72d08e..9fab7f3f94e 100644 --- a/spec/support/shared_examples/controllers/clusters_controller_shared_examples.rb +++ b/spec/support/shared_examples/controllers/clusters_controller_shared_examples.rb @@ -27,3 +27,33 @@ RSpec.shared_examples 'GET new cluster shared examples' do end end end + +RSpec.shared_examples ':certificate_based_clusters feature flag index responses' do + context 'feature flag is disabled' do + before do + stub_feature_flags(certificate_based_clusters: false) + end + + it 'does not list any clusters' do + subject + + expect(response).to have_gitlab_http_status(:ok) + expect(response).to render_template(:index) + expect(assigns(:clusters)).to be_empty + end + end +end + +RSpec.shared_examples ':certificate_based_clusters feature flag controller responses' do + context 'feature flag is disabled' do + before do + stub_feature_flags(certificate_based_clusters: false) + end + + it 'responds with :not_found' do + subject + + expect(response).to have_gitlab_http_status(:not_found) + end + end +end |