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
diff options
context:
space:
mode:
Diffstat (limited to 'spec/helpers/clusters_helper_spec.rb')
-rw-r--r--spec/helpers/clusters_helper_spec.rb26
1 files changed, 16 insertions, 10 deletions
diff --git a/spec/helpers/clusters_helper_spec.rb b/spec/helpers/clusters_helper_spec.rb
index c41d4f0ede7..dff83005c89 100644
--- a/spec/helpers/clusters_helper_spec.rb
+++ b/spec/helpers/clusters_helper_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-describe ClustersHelper do
+RSpec.describe ClustersHelper do
describe '#has_rbac_enabled?' do
context 'when kubernetes platform has been created' do
let(:platform_kubernetes) { build_stubbed(:cluster_platform_kubernetes) }
@@ -60,18 +60,24 @@ describe ClustersHelper do
end
describe '#js_clusters_list_data' do
- it 'displays endpoint path and images' do
- js_data = helper.js_clusters_list_data('/path')
+ subject { helper.js_clusters_list_data('/path') }
- expect(js_data[:endpoint]).to eq('/path')
+ it 'displays endpoint path' do
+ expect(subject[:endpoint]).to eq('/path')
+ end
+
+ it 'generates svg image data', :aggregate_failures do
+ expect(subject.dig(:img_tags, :aws, :path)).to match(%r(/illustrations/logos/amazon_eks|svg))
+ expect(subject.dig(:img_tags, :default, :path)).to match(%r(/illustrations/logos/kubernetes|svg))
+ expect(subject.dig(:img_tags, :gcp, :path)).to match(%r(/illustrations/logos/google_gke|svg))
- expect(js_data.dig(:img_tags, :aws, :path)).to match(%r(/illustrations/logos/amazon_eks|svg))
- expect(js_data.dig(:img_tags, :default, :path)).to match(%r(/illustrations/logos/kubernetes|svg))
- expect(js_data.dig(:img_tags, :gcp, :path)).to match(%r(/illustrations/logos/google_gke|svg))
+ expect(subject.dig(:img_tags, :aws, :text)).to eq('Amazon EKS')
+ expect(subject.dig(:img_tags, :default, :text)).to eq('Kubernetes Cluster')
+ expect(subject.dig(:img_tags, :gcp, :text)).to eq('Google GKE')
+ end
- expect(js_data.dig(:img_tags, :aws, :text)).to eq('Amazon EKS')
- expect(js_data.dig(:img_tags, :default, :text)).to eq('Kubernetes Cluster')
- expect(js_data.dig(:img_tags, :gcp, :text)).to eq('Google GKE')
+ it 'displays and ancestor_help_path' do
+ expect(subject[:ancestor_help_path]).to eq('/help/user/group/clusters/index#cluster-precedence')
end
end