Commit 94c0ca31 authored by Thong Kuah's avatar Thong Kuah

EE: Move EE specific code into ee/ dir

Restore app/helpers/clusters_helper.rb to CE, move override to EE
module.
parent c4d8fc61
# frozen_string_literal: true
module ClustersHelper
prepend EE::ClustersHelper
# EE overrides this
def has_multiple_clusters?
clusterable.feature_available?(:multiple_clusters)
false
end
def render_gcp_signup_offer
......
# frozen_string_literal: true
module EE
module ClustersHelper
extend ::Gitlab::Utils::Override
override :has_multiple_clusters?
def has_multiple_clusters?
clusterable.feature_available?(:multiple_clusters)
end
end
end
# frozen_string_literal: true
require 'spec_helper'
describe ClustersHelper do
describe '#has_multiple_clusters?' do
let(:project) { build(:project) }
subject { helper.has_multiple_clusters? }
before do
# clusterable is provided as a `helper_method`
allow(helper).to receive(:clusterable).and_return(project)
end
context 'license is premium' do
before do
expect(project).to receive(:feature_available?).with(:multiple_clusters).and_return(true)
end
it { is_expected.to be_truthy }
end
context 'license is starter' do
before do
expect(project).to receive(:feature_available?).with(:multiple_clusters).and_return(false)
end
it { is_expected.to be_falsey }
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment