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

instance_clusterable_presenter_spec.rb « presenters « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0ace57bbf4dbbcee32ce39135dc7703e7ed2e973 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe InstanceClusterablePresenter do
  include Gitlab::Routing.url_helpers

  let(:presenter) { described_class.new(instance) }
  let(:cluster) { create(:cluster, :provided_by_gcp, :instance) }
  let(:instance) { cluster.instance }

  describe '#create_aws_clusters_path' do
    subject { described_class.new(instance).create_aws_clusters_path }

    it { is_expected.to eq(create_aws_admin_clusters_path) }
  end

  describe '#authorize_aws_role_path' do
    subject { described_class.new(instance).authorize_aws_role_path }

    it { is_expected.to eq(authorize_aws_role_admin_clusters_path) }
  end

  describe '#clear_cluster_cache_path' do
    subject { presenter.clear_cluster_cache_path(cluster) }

    it { is_expected.to eq(clear_cache_admin_cluster_path(cluster)) }
  end

  describe '#metrics_dashboard_path' do
    subject { presenter.metrics_dashboard_path(cluster) }

    it { is_expected.to eq(metrics_dashboard_admin_cluster_path(cluster)) }
  end

  describe '#learn_more_link' do
    subject { presenter.learn_more_link }

    it { is_expected.to include('user/instance/clusters/index') }
  end
end