diff options
author | Mike Greiling <mike@pixelcog.com> | 2018-12-20 12:39:09 +0300 |
---|---|---|
committer | Kushal Pandya <kushalspandya@gmail.com> | 2018-12-20 12:39:09 +0300 |
commit | 9f0983a4b160fac67552b0795f445b08e940ef16 (patch) | |
tree | d01b0f29b4255773857e57cba0ad40cc19537676 /spec/serializers/environment_entity_spec.rb | |
parent | 70ba4ba2851f42ed1d3a31e4994d89b59c619570 (diff) |
Resolve "Hide cluster features that don't work yet with Group Clusters"
Diffstat (limited to 'spec/serializers/environment_entity_spec.rb')
-rw-r--r-- | spec/serializers/environment_entity_spec.rb | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/spec/serializers/environment_entity_spec.rb b/spec/serializers/environment_entity_spec.rb index b7324a26ed2..791b64dc356 100644 --- a/spec/serializers/environment_entity_spec.rb +++ b/spec/serializers/environment_entity_spec.rb @@ -40,4 +40,34 @@ describe EnvironmentEntity do expect(subject).to include(:metrics_path) end end + + context 'with deployment platform' do + let(:project) { create(:project, :repository) } + let(:environment) { create(:environment, project: project) } + + context 'when deployment platform is a cluster' do + before do + create(:cluster, + :provided_by_gcp, + :project, + environment_scope: '*', + projects: [project]) + end + + it 'should include cluster_type' do + expect(subject).to include(:cluster_type) + expect(subject[:cluster_type]).to eq('project_type') + end + end + + context 'when deployment platform is a Kubernetes Service' do + before do + create(:kubernetes_service, project: project) + end + + it 'should not include cluster_type' do + expect(subject).not_to include(:cluster_type) + end + end + end end |