summaryrefslogtreecommitdiff
path: root/spec/controllers/admin
diff options
context:
space:
mode:
authorThong Kuah <tkuah@gitlab.com>2019-06-28 00:29:19 +1200
committerThong Kuah <tkuah@gitlab.com>2019-06-28 01:24:05 +1200
commit8152efbe2fc486520ec5cd11d54a49fbf7e554bf (patch)
tree224aa61a7751385b9963faaf773f3b9f3d9e6dcc /spec/controllers/admin
parent3f759e1674b19f9fc7690239c138fca8aeec6434 (diff)
downloadgitlab-ce-8152efbe2fc486520ec5cd11d54a49fbf7e554bf.tar.gz
Remove instance_clusters feature_flagremove_group_and_instance_clusters_feature_flag
Now we have terminals for instance and group clusters we can remove the FF now. Deploying to instance clusters has been working without complaints too.
Diffstat (limited to 'spec/controllers/admin')
-rw-r--r--spec/controllers/admin/clusters/applications_controller_spec.rb10
-rw-r--r--spec/controllers/admin/clusters_controller_spec.rb76
2 files changed, 29 insertions, 57 deletions
diff --git a/spec/controllers/admin/clusters/applications_controller_spec.rb b/spec/controllers/admin/clusters/applications_controller_spec.rb
index 76f261e7d3f..cf202d88acc 100644
--- a/spec/controllers/admin/clusters/applications_controller_spec.rb
+++ b/spec/controllers/admin/clusters/applications_controller_spec.rb
@@ -13,16 +13,6 @@ describe Admin::Clusters::ApplicationsController do
it { expect { subject }.to be_allowed_for(:admin) }
it { expect { subject }.to be_denied_for(:user) }
it { expect { subject }.to be_denied_for(:external) }
-
- context 'when instance clusters are disabled' do
- before do
- stub_feature_flags(instance_clusters: false)
- end
-
- it 'returns 404' do
- is_expected.to have_http_status(:not_found)
- end
- end
end
let(:cluster) { create(:cluster, :instance, :provided_by_gcp) }
diff --git a/spec/controllers/admin/clusters_controller_spec.rb b/spec/controllers/admin/clusters_controller_spec.rb
index 7709f525119..e5501535875 100644
--- a/spec/controllers/admin/clusters_controller_spec.rb
+++ b/spec/controllers/admin/clusters_controller_spec.rb
@@ -17,66 +17,48 @@ describe Admin::ClustersController do
get :index, params: params
end
- context 'when feature flag is not enabled' do
- before do
- stub_feature_flags(instance_clusters: false)
- end
+ describe 'functionality' do
+ context 'when instance has one or more clusters' do
+ let!(:enabled_cluster) do
+ create(:cluster, :provided_by_gcp, :instance)
+ end
- it 'responds with not found' do
- get_index
+ let!(:disabled_cluster) do
+ create(:cluster, :disabled, :provided_by_gcp, :production_environment, :instance)
+ end
- expect(response).to have_gitlab_http_status(404)
- end
- end
+ it 'lists available clusters' do
+ get_index
- context 'when feature flag is enabled' do
- before do
- stub_feature_flags(instance_clusters: true)
- end
+ expect(response).to have_gitlab_http_status(:ok)
+ expect(response).to render_template(:index)
+ expect(assigns(:clusters)).to match_array([enabled_cluster, disabled_cluster])
+ end
- describe 'functionality' do
- context 'when instance has one or more clusters' do
- let!(:enabled_cluster) do
- create(:cluster, :provided_by_gcp, :instance)
- end
+ context 'when page is specified' do
+ let(:last_page) { Clusters::Cluster.instance_type.page.total_pages }
- let!(:disabled_cluster) do
- create(:cluster, :disabled, :provided_by_gcp, :production_environment, :instance)
+ before do
+ allow(Clusters::Cluster).to receive(:paginates_per).and_return(1)
+ create_list(:cluster, 2, :provided_by_gcp, :production_environment, :instance)
end
- it 'lists available clusters' do
- get_index
+ it 'redirects to the page' do
+ get_index(page: last_page)
expect(response).to have_gitlab_http_status(:ok)
- expect(response).to render_template(:index)
- expect(assigns(:clusters)).to match_array([enabled_cluster, disabled_cluster])
- end
-
- context 'when page is specified' do
- let(:last_page) { Clusters::Cluster.instance_type.page.total_pages }
-
- before do
- allow(Clusters::Cluster).to receive(:paginates_per).and_return(1)
- create_list(:cluster, 2, :provided_by_gcp, :production_environment, :instance)
- end
-
- it 'redirects to the page' do
- get_index(page: last_page)
-
- expect(response).to have_gitlab_http_status(:ok)
- expect(assigns(:clusters).current_page).to eq(last_page)
- end
+ expect(assigns(:clusters).current_page).to eq(last_page)
end
end
+ end
- context 'when instance does not have a cluster' do
- it 'returns an empty state page' do
- get_index
+ context 'when instance does not have a cluster' do
+ it 'returns an empty state page' do
+ get_index
- expect(response).to have_gitlab_http_status(:ok)
- expect(response).to render_template(:index, partial: :empty_state)
- expect(assigns(:clusters)).to eq([])
- end
+ expect(response).to have_gitlab_http_status(:ok)
+ expect(response).to render_template(:index, partial: :empty_state)
+ expect(assigns(:clusters)).to eq([])
end
end
end