2019-11-13 01:06:38 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-24 02:09:01 -04:00
|
|
|
RSpec.describe InstanceClusterablePresenter do
|
2019-11-13 01:06:38 -05:00
|
|
|
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
|
|
|
|
|
2019-11-26 04:08:36 -05:00
|
|
|
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
|
2020-07-13 11:09:08 -04:00
|
|
|
|
|
|
|
describe '#metrics_dashboard_path' do
|
|
|
|
subject { presenter.metrics_dashboard_path(cluster) }
|
|
|
|
|
|
|
|
it { is_expected.to eq(metrics_dashboard_admin_cluster_path(cluster)) }
|
|
|
|
end
|
2021-09-28 05:11:19 -04:00
|
|
|
|
|
|
|
describe '#learn_more_link' do
|
|
|
|
subject { presenter.learn_more_link }
|
|
|
|
|
|
|
|
it { is_expected.to include('user/instance/clusters/index') }
|
|
|
|
end
|
2019-11-13 01:06:38 -05:00
|
|
|
end
|