gitlab-org--gitlab-foss/spec/finders/clusters_finder_spec.rb
Mayra Cabrera ca59bfdc66 Rearrange DeploymentPlatform methods
- Change find_cluster_platform_kubernetes to ignore environment argument
- Fix broken specs

CE Port of: https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/5047/
2018-03-22 14:52:33 -06:00

31 lines
858 B
Ruby

require 'spec_helper'
describe ClustersFinder do
let(:project) { create(:project) }
set(:user) { create(:user) }
describe '#execute' do
let(:enabled_cluster) { create(:cluster, :provided_by_gcp, projects: [project]) }
let(:disabled_cluster) { create(:cluster, :disabled, :provided_by_gcp, :production_environment, projects: [project]) }
subject { described_class.new(project, user, scope).execute }
context 'when scope is all' do
let(:scope) { :all }
it { is_expected.to match_array([enabled_cluster, disabled_cluster]) }
end
context 'when scope is active' do
let(:scope) { :active }
it { is_expected.to match_array([enabled_cluster]) }
end
context 'when scope is inactive' do
let(:scope) { :inactive }
it { is_expected.to match_array([disabled_cluster]) }
end
end
end