summaryrefslogtreecommitdiff
path: root/spec/helpers
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-04-10 15:09:50 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-04-10 15:09:50 +0000
commitde2fb5b82c92c90f90ed67ced45143c04e934fb8 (patch)
treeff8e5e642580de7bb596d90dd0e7f739f44ca540 /spec/helpers
parentc6a33b298229f9e04933be43d6176c476ef03012 (diff)
downloadgitlab-ce-de2fb5b82c92c90f90ed67ced45143c04e934fb8.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/helpers')
-rw-r--r--spec/helpers/clusters_helper_spec.rb35
1 files changed, 35 insertions, 0 deletions
diff --git a/spec/helpers/clusters_helper_spec.rb b/spec/helpers/clusters_helper_spec.rb
index 5651b899ed0..eec62bbb990 100644
--- a/spec/helpers/clusters_helper_spec.rb
+++ b/spec/helpers/clusters_helper_spec.rb
@@ -58,4 +58,39 @@ describe ClustersHelper do
it { is_expected.to eq('Create new cluster') }
end
end
+
+ describe '#cluster_type_label' do
+ subject { helper.cluster_type_label(cluster_type) }
+
+ context 'project cluster' do
+ let(:cluster_type) { 'project_type' }
+
+ it { is_expected.to eq('Project cluster') }
+ end
+
+ context 'group cluster' do
+ let(:cluster_type) { 'group_type' }
+
+ it { is_expected.to eq('Group cluster') }
+ end
+
+ context 'instance cluster' do
+ let(:cluster_type) { 'instance_type' }
+
+ it { is_expected.to eq('Instance cluster') }
+ end
+
+ context 'other values' do
+ let(:cluster_type) { 'not_supported' }
+
+ it 'Diplays generic cluster and reports error' do
+ expect(Gitlab::ErrorTracking).to receive(:track_and_raise_for_dev_exception).with(
+ an_instance_of(ArgumentError),
+ cluster_error: { error: 'Cluster Type Missing', cluster_type: 'not_supported' }
+ )
+
+ is_expected.to eq('Cluster')
+ end
+ end
+ end
end