diff options
author | Shinya Maeda <shinya@gitlab.com> | 2017-11-27 21:48:54 +0900 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2017-11-28 20:47:59 +0900 |
commit | 1d7e3ef1a55991e057213add556926eb13e0bd48 (patch) | |
tree | 42a63fbc0cb956d2207340aa86ba57dd1e39d572 /spec/models/environment_spec.rb | |
parent | 5324383dba07d60407a5b947f27695867ad45843 (diff) | |
download | gitlab-ce-1d7e3ef1a55991e057213add556926eb13e0bd48.tar.gz |
Duplicate spec for Platform::Kubernetes with kubernetes_project
Diffstat (limited to 'spec/models/environment_spec.rb')
-rw-r--r-- | spec/models/environment_spec.rb | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/spec/models/environment_spec.rb b/spec/models/environment_spec.rb index 1ce1d595c60..de030844a28 100644 --- a/spec/models/environment_spec.rb +++ b/spec/models/environment_spec.rb @@ -327,15 +327,28 @@ describe Environment do context 'when the enviroment is available' do context 'with a deployment service' do - let(:project) { create(:kubernetes_project) } + shared_examples 'correct behavior for has_terminals?' do + context 'and a deployment' do + let!(:deployment) { create(:deployment, environment: environment) } + it { is_expected.to be_truthy } + end - context 'and a deployment' do - let!(:deployment) { create(:deployment, environment: environment) } - it { is_expected.to be_truthy } + context 'but no deployments' do + it { is_expected.to be_falsy } + end end - context 'but no deployments' do - it { is_expected.to be_falsy } + context 'when user configured kubernetes from Integration > Kubernetes' do + let(:project) { create(:kubernetes_project) } + + it_behaves_like 'correct behavior for has_terminals?' + end + + context 'when user configured kubernetes from CI/CD > Clusters' do + let!(:cluster) { create(:cluster, :project, :provided_by_gcp) } + let(:project) { cluster.project } + + it_behaves_like 'correct behavior for has_terminals?' end end |