Use Environment#deployment_platform method instead
As this method does have `deployment_platform(environment: self.name)`, which is what the form EE needs. Allows us to remove two overrides in EE.
This commit is contained in:
parent
a4777d6ea9
commit
0398213d20
|
@ -155,11 +155,11 @@ class Environment < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def has_terminals?
|
def has_terminals?
|
||||||
project.deployment_platform.present? && available? && last_deployment.present?
|
deployment_platform.present? && available? && last_deployment.present?
|
||||||
end
|
end
|
||||||
|
|
||||||
def terminals
|
def terminals
|
||||||
project.deployment_platform.terminals(self) if has_terminals?
|
deployment_platform.terminals(self) if has_terminals?
|
||||||
end
|
end
|
||||||
|
|
||||||
def has_metrics?
|
def has_metrics?
|
||||||
|
|
|
@ -592,9 +592,7 @@ describe Environment do
|
||||||
|
|
||||||
shared_examples 'same behavior between KubernetesService and Platform::Kubernetes' do
|
shared_examples 'same behavior between KubernetesService and Platform::Kubernetes' do
|
||||||
it 'returns the terminals from the deployment service' do
|
it 'returns the terminals from the deployment service' do
|
||||||
deployment_platform_target = Gitlab.ee? ? environment : project
|
expect(environment.deployment_platform)
|
||||||
|
|
||||||
expect(deployment_platform_target.deployment_platform)
|
|
||||||
.to receive(:terminals).with(environment)
|
.to receive(:terminals).with(environment)
|
||||||
.and_return(:fake_terminals)
|
.and_return(:fake_terminals)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue