2019-12-26 22:10:19 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-07-28 23:09:34 +05:30
|
|
|
RSpec.describe InstanceClusterablePresenter do
|
2019-12-26 22:10:19 +05:30
|
|
|
include Gitlab::Routing.url_helpers
|
|
|
|
|
|
|
|
let(:presenter) { described_class.new(instance) }
|
|
|
|
let(:cluster) { create(:cluster, :provided_by_gcp, :instance) }
|
|
|
|
let(:instance) { cluster.instance }
|
|
|
|
|
2022-05-07 20:08:51 +05:30
|
|
|
describe '#connect_path' do
|
|
|
|
subject { described_class.new(instance).connect_path }
|
|
|
|
|
|
|
|
it { is_expected.to eq(connect_admin_clusters_path) }
|
|
|
|
end
|
|
|
|
|
2020-01-01 13:55:28 +05:30
|
|
|
describe '#clear_cluster_cache_path' do
|
|
|
|
subject { presenter.clear_cluster_cache_path(cluster) }
|
2019-12-26 22:10:19 +05:30
|
|
|
|
2020-01-01 13:55:28 +05:30
|
|
|
it { is_expected.to eq(clear_cache_admin_cluster_path(cluster)) }
|
2019-12-26 22:10:19 +05:30
|
|
|
end
|
2020-07-28 23:09:34 +05:30
|
|
|
|
|
|
|
describe '#metrics_dashboard_path' do
|
|
|
|
subject { presenter.metrics_dashboard_path(cluster) }
|
|
|
|
|
|
|
|
it { is_expected.to eq(metrics_dashboard_admin_cluster_path(cluster)) }
|
|
|
|
end
|
2021-11-18 22:05:49 +05:30
|
|
|
|
|
|
|
describe '#learn_more_link' do
|
|
|
|
subject { presenter.learn_more_link }
|
|
|
|
|
|
|
|
it { is_expected.to include('user/instance/clusters/index') }
|
|
|
|
end
|
2019-12-26 22:10:19 +05:30
|
|
|
end
|