diff options
-rw-r--r-- | app/models/environment.rb | 4 | ||||
-rw-r--r-- | spec/models/environment_spec.rb | 4 |
2 files changed, 3 insertions, 5 deletions
diff --git a/app/models/environment.rb b/app/models/environment.rb index 0eda7a2513f..aff20dae09b 100644 --- a/app/models/environment.rb +++ b/app/models/environment.rb @@ -155,11 +155,11 @@ class Environment < ApplicationRecord end def has_terminals? - project.deployment_platform.present? && available? && last_deployment.present? + deployment_platform.present? && available? && last_deployment.present? end def terminals - project.deployment_platform.terminals(self) if has_terminals? + deployment_platform.terminals(self) if has_terminals? end def has_metrics? diff --git a/spec/models/environment_spec.rb b/spec/models/environment_spec.rb index cfe7c7ef0b0..17246f238e0 100644 --- a/spec/models/environment_spec.rb +++ b/spec/models/environment_spec.rb @@ -592,9 +592,7 @@ describe Environment do shared_examples 'same behavior between KubernetesService and Platform::Kubernetes' do it 'returns the terminals from the deployment service' do - deployment_platform_target = Gitlab.ee? ? environment : project - - expect(deployment_platform_target.deployment_platform) + expect(environment.deployment_platform) .to receive(:terminals).with(environment) .and_return(:fake_terminals) |