diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-22 00:06:08 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-22 00:06:08 +0000 |
commit | 157f9a451a428f66666ba85d8b880df78aff6cc4 (patch) | |
tree | 7c38cacafb9720d144a6add0a170a07a7cc376f6 /spec/presenters | |
parent | 7f15e74dae019ac96c65ec769eae2d67aae65a8c (diff) | |
download | gitlab-ce-157f9a451a428f66666ba85d8b880df78aff6cc4.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/presenters')
-rw-r--r-- | spec/presenters/clusters/cluster_presenter_spec.rb | 39 |
1 files changed, 35 insertions, 4 deletions
diff --git a/spec/presenters/clusters/cluster_presenter_spec.rb b/spec/presenters/clusters/cluster_presenter_spec.rb index 8bc5374f2db..6a1360807b7 100644 --- a/spec/presenters/clusters/cluster_presenter_spec.rb +++ b/spec/presenters/clusters/cluster_presenter_spec.rb @@ -153,11 +153,42 @@ describe Clusters::ClusterPresenter do end end - describe '#gke_cluster_url' do - subject { described_class.new(cluster).gke_cluster_url } + describe '#provider_label' do + let(:cluster) { create(:cluster, provider_type: provider_type) } - it { is_expected.to include(cluster.provider.zone) } - it { is_expected.to include(cluster.name) } + subject { described_class.new(cluster).provider_label } + + context 'AWS provider' do + let(:provider_type) { :aws } + + it { is_expected.to eq('Elastic Kubernetes Service') } + end + + context 'GCP provider' do + let(:provider_type) { :gcp } + + it { is_expected.to eq('Google Kubernetes Engine') } + end + end + + describe '#provider_management_url' do + let(:cluster) { provider.cluster } + + subject { described_class.new(cluster).provider_management_url } + + context 'AWS provider' do + let(:provider) { create(:cluster_provider_aws) } + + it { is_expected.to include(provider.region) } + it { is_expected.to include(cluster.name) } + end + + context 'GCP provider' do + let(:provider) { create(:cluster_provider_gcp) } + + it { is_expected.to include(provider.zone) } + it { is_expected.to include(cluster.name) } + end end describe '#cluster_type_description' do |