diff options
author | Mayra Cabrera <mcabrera@gitlab.com> | 2019-03-29 18:23:18 +0000 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2019-03-29 18:23:18 +0000 |
commit | ab06d1eda2fa222b4de400d2b18eab611ffefa68 (patch) | |
tree | 978ed57b01da01e1187db25f0423e2ada85550b7 /spec/models/clusters | |
parent | 0df75d241a5054a19086dca29cca4d65ac1736fe (diff) | |
download | gitlab-ce-ab06d1eda2fa222b4de400d2b18eab611ffefa68.tar.gz |
Renames Cluster#managed? to provided_by_user?
This will allow to user the term managed? on
https://gitlab.com/gitlab-org/gitlab-ce/issues/56557. Managed? will be
used to distinct clusters that are automatically managed by GitLab
Diffstat (limited to 'spec/models/clusters')
-rw-r--r-- | spec/models/clusters/cluster_spec.rb | 16 | ||||
-rw-r--r-- | spec/models/clusters/platforms/kubernetes_spec.rb | 2 |
2 files changed, 17 insertions, 1 deletions
diff --git a/spec/models/clusters/cluster_spec.rb b/spec/models/clusters/cluster_spec.rb index acbcdc7d170..fabd2806d9a 100644 --- a/spec/models/clusters/cluster_spec.rb +++ b/spec/models/clusters/cluster_spec.rb @@ -620,4 +620,20 @@ describe Clusters::Cluster do end end end + + describe '#provided_by_user?' do + subject { cluster.provided_by_user? } + + context 'with a GCP provider' do + let(:cluster) { create(:cluster, :provided_by_gcp) } + + it { is_expected.to be_falsy } + end + + context 'with an user provider' do + let(:cluster) { create(:cluster, :provided_by_user) } + + it { is_expected.to be_truthy } + end + end end diff --git a/spec/models/clusters/platforms/kubernetes_spec.rb b/spec/models/clusters/platforms/kubernetes_spec.rb index af65530e663..a79b436c22a 100644 --- a/spec/models/clusters/platforms/kubernetes_spec.rb +++ b/spec/models/clusters/platforms/kubernetes_spec.rb @@ -15,7 +15,7 @@ describe Clusters::Platforms::Kubernetes, :use_clean_rails_memory_store_caching it { is_expected.to delegate_method(:project).to(:cluster) } it { is_expected.to delegate_method(:enabled?).to(:cluster) } - it { is_expected.to delegate_method(:managed?).to(:cluster) } + it { is_expected.to delegate_method(:provided_by_user?).to(:cluster) } it { is_expected.to delegate_method(:kubernetes_namespace).to(:cluster) } it_behaves_like 'having unique enum values' |