2018-12-10 07:33:36 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-24 02:09:01 -04:00
|
|
|
RSpec.describe Clusters::BuildService do
|
2018-12-10 07:33:36 -05:00
|
|
|
describe '#execute' do
|
|
|
|
subject { described_class.new(cluster_subject).execute }
|
|
|
|
|
|
|
|
describe 'when cluster subject is a project' do
|
|
|
|
let(:cluster_subject) { build(:project) }
|
|
|
|
|
|
|
|
it 'sets the cluster_type to project_type' do
|
|
|
|
is_expected.to be_project_type
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
describe 'when cluster subject is a group' do
|
|
|
|
let(:cluster_subject) { build(:group) }
|
|
|
|
|
|
|
|
it 'sets the cluster_type to group_type' do
|
|
|
|
is_expected.to be_group_type
|
|
|
|
end
|
|
|
|
end
|
2019-04-09 22:13:43 -04:00
|
|
|
|
|
|
|
describe 'when cluster subject is an instance' do
|
|
|
|
let(:cluster_subject) { Clusters::Instance.new }
|
|
|
|
|
|
|
|
it 'sets the cluster_type to instance_type' do
|
|
|
|
is_expected.to be_instance_type
|
|
|
|
end
|
|
|
|
end
|
2018-12-10 07:33:36 -05:00
|
|
|
end
|
|
|
|
end
|