diff options
author | James Fargher <proglottis@gmail.com> | 2019-05-02 04:07:38 +0300 |
---|---|---|
committer | James Fargher <proglottis@gmail.com> | 2019-05-06 23:37:04 +0300 |
commit | beb66cfcba26d0796644ccce2dfac8c65a808144 (patch) | |
tree | 6bb32fccb64f91776e946d84c5717d1ae52a9d7e /spec/controllers/admin | |
parent | 8db382b05545fdef0a60bcff65f8c23e8b1ed282 (diff) |
Check instance cluster feature at policy level
Try to simplify feature flag checks by using policies
Diffstat (limited to 'spec/controllers/admin')
-rw-r--r-- | spec/controllers/admin/clusters/applications_controller_spec.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/controllers/admin/clusters/applications_controller_spec.rb b/spec/controllers/admin/clusters/applications_controller_spec.rb index cf202d88acc..76f261e7d3f 100644 --- a/spec/controllers/admin/clusters/applications_controller_spec.rb +++ b/spec/controllers/admin/clusters/applications_controller_spec.rb @@ -13,6 +13,16 @@ 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) } |