diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2017-10-16 08:12:46 +0000 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2017-10-16 08:12:46 +0000 |
commit | 076231798dd9716479d8eef118678eeb7c2c7b11 (patch) | |
tree | e127bc6c18512bde7882363a4c23061e2d6fad0e /spec | |
parent | 7a8b97e10854f3e2f6e51a2f45bcf80cfdb9926a (diff) | |
parent | a6b2387d3fa270e6c6069c1b7c52d01f2eb820d3 (diff) | |
download | gitlab-ce-076231798dd9716479d8eef118678eeb7c2c7b11.tar.gz |
Merge branch 'fix/sm/38960-collect-usage-pings-gcp-cluster-enabled-and-gcp-cluster-disabled-instead-of-gcp-cluster-count' into 'master'
Collect usage pings `Gcp::Cluster.enabled` and `Gcp::Cluster.disabled`, instead of `Gcp::Cluster.count`
Closes #38960
See merge request gitlab-org/gitlab-ce!14807
Diffstat (limited to 'spec')
-rw-r--r-- | spec/lib/gitlab/usage_data_spec.rb | 2 | ||||
-rw-r--r-- | spec/models/gcp/cluster_spec.rb | 24 |
2 files changed, 26 insertions, 0 deletions
diff --git a/spec/lib/gitlab/usage_data_spec.rb b/spec/lib/gitlab/usage_data_spec.rb index 777e9c8e21d..a7b65e94706 100644 --- a/spec/lib/gitlab/usage_data_spec.rb +++ b/spec/lib/gitlab/usage_data_spec.rb @@ -61,6 +61,8 @@ describe Gitlab::UsageData do deployments environments gcp_clusters + gcp_clusters_enabled + gcp_clusters_disabled in_review_folder groups issues diff --git a/spec/models/gcp/cluster_spec.rb b/spec/models/gcp/cluster_spec.rb index 350fbc257d9..8f39fff6394 100644 --- a/spec/models/gcp/cluster_spec.rb +++ b/spec/models/gcp/cluster_spec.rb @@ -7,6 +7,30 @@ describe Gcp::Cluster do it { is_expected.to validate_presence_of(:gcp_cluster_zone) } + describe '.enabled' do + subject { described_class.enabled } + + let!(:cluster) { create(:gcp_cluster, enabled: true) } + + before do + create(:gcp_cluster, enabled: false) + end + + it { is_expected.to contain_exactly(cluster) } + end + + describe '.disabled' do + subject { described_class.disabled } + + let!(:cluster) { create(:gcp_cluster, enabled: false) } + + before do + create(:gcp_cluster, enabled: true) + end + + it { is_expected.to contain_exactly(cluster) } + end + describe '#default_value_for' do let(:cluster) { described_class.new } |