diff options
author | Mayra Cabrera <mcabrera@gitlab.com> | 2019-03-25 18:18:39 +0300 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2019-03-25 18:18:39 +0300 |
commit | 93b806c468a5a88950d28f82f99294ee0e8cef13 (patch) | |
tree | ab5724e779da68c2c35a945bcd81b35e726a1d76 /spec/helpers/clusters_helper_spec.rb | |
parent | 1f42dd868b3410cff688193bad0ca25673b18ce6 (diff) |
Improvements for Knative installation
Displays Knative domain field automatically after Helm is successfully
installed.
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/56954
Diffstat (limited to 'spec/helpers/clusters_helper_spec.rb')
-rw-r--r-- | spec/helpers/clusters_helper_spec.rb | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/spec/helpers/clusters_helper_spec.rb b/spec/helpers/clusters_helper_spec.rb new file mode 100644 index 00000000000..4ea0f76fc28 --- /dev/null +++ b/spec/helpers/clusters_helper_spec.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe ClustersHelper do + describe '#has_rbac_enabled?' do + context 'when kubernetes platform has been created' do + let(:platform_kubernetes) { build_stubbed(:cluster_platform_kubernetes) } + let(:cluster) { build_stubbed(:cluster, :provided_by_gcp, platform_kubernetes: platform_kubernetes) } + + it 'returns kubernetes platform value' do + expect(helper.has_rbac_enabled?(cluster)).to be_truthy + end + end + + context 'when kubernetes platform has not been created yet' do + let(:cluster) { build_stubbed(:cluster, :providing_by_gcp) } + + it 'delegates to cluster provider' do + expect(helper.has_rbac_enabled?(cluster)).to be_truthy + end + + context 'when ABAC cluster is created' do + let(:provider) { build_stubbed(:cluster_provider_gcp, :abac_enabled) } + let(:cluster) { build_stubbed(:cluster, :providing_by_gcp, provider_gcp: provider) } + + it 'delegates to cluster provider' do + expect(helper.has_rbac_enabled?(cluster)).to be_falsy + end + end + end + end +end |