Commit 5c2c9a3f authored by Rémy Coutable's avatar Rémy Coutable

Resolve conflict in app/models/environment.rb

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent 3a1aa0a5
......@@ -137,16 +137,16 @@ class Environment < ActiveRecord::Base
end
end
def deployment_service_ready?
def has_terminals?
project.deployment_platform.present? && available? && last_deployment.present?
end
def terminals
project.deployment_platform.terminals(self) if deployment_service_ready?
project.deployment_platform.terminals(self) if has_terminals?
end
def rollout_status
project.deployment_service.rollout_status(self) if deployment_service_ready?
project.deployment_platform.rollout_status(self) if has_terminals?
end
def has_metrics?
......
......@@ -386,29 +386,6 @@ describe Environment do
end
end
<<<<<<< HEAD
shared_examples 'same behavior between KubernetesService and Platform::Kubernetes' do
it 'returns the terminals from the deployment service' do
expect(project.deployment_platform)
.to receive(:terminals).with(environment)
.and_return(:fake_terminals)
is_expected.to eq(:fake_terminals)
end
end
context 'when user configured kubernetes from Integration > Kubernetes' do
let(:project) { create(:kubernetes_project) }
it_behaves_like 'same behavior between KubernetesService and Platform::Kubernetes'
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 'same behavior between KubernetesService and Platform::Kubernetes'
=======
context 'when user configured kubernetes from Integration > Kubernetes' do
let(:project) { create(:kubernetes_project) }
......@@ -420,7 +397,6 @@ describe Environment do
let(:project) { cluster.project }
it_behaves_like 'same behavior between KubernetesService and Platform::Kubernetes'
>>>>>>> origin/master
end
end
......@@ -451,17 +427,10 @@ describe Environment do
end
end
<<<<<<< HEAD
it 'returns the rollout status from the deployment service' do
expect(project.deployment_platform)
.to receive(:rollout_status).with(environment)
.and_return(:fake_rollout_status)
=======
context 'when the environment does not have rollout status' do
before do
allow(environment).to receive(:has_terminals?).and_return(false)
end
>>>>>>> origin/master
it { is_expected.to eq(nil) }
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment