Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2017-10-16 11:12:46 +0300
committerWinnie Hellmann <winnie@gitlab.com>2017-10-18 12:11:24 +0300
commit4c552a52260d2192a3bb654a0a83d8aea9551d07 (patch)
tree7d3966a1787b04a07c61ba08b053070becfbf4dd /spec
parente82af4a6b340f6c49ec18bd13fc9974cf08b097e (diff)
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 (cherry picked from commit 076231798dd9716479d8eef118678eeb7c2c7b11) a6b2387d Collect usage pings `Gcp::Cluster.enabled` and `Gcp::Cluster.disabled`, instead…
Diffstat (limited to 'spec')
-rw-r--r--spec/lib/gitlab/usage_data_spec.rb2
-rw-r--r--spec/models/gcp/cluster_spec.rb24
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 }