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 ...@@ -137,16 +137,16 @@ class Environment < ActiveRecord::Base
end end
end end
def deployment_service_ready? def has_terminals?
project.deployment_platform.present? && available? && last_deployment.present? project.deployment_platform.present? && available? && last_deployment.present?
end end
def terminals def terminals
project.deployment_platform.terminals(self) if deployment_service_ready? project.deployment_platform.terminals(self) if has_terminals?
end end
def rollout_status def rollout_status
project.deployment_service.rollout_status(self) if deployment_service_ready? project.deployment_platform.rollout_status(self) if has_terminals?
end end
def has_metrics? def has_metrics?
......
...@@ -386,17 +386,6 @@ describe Environment do ...@@ -386,17 +386,6 @@ describe Environment do
end end
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 context 'when user configured kubernetes from Integration > Kubernetes' do
let(:project) { create(:kubernetes_project) } let(:project) { create(:kubernetes_project) }
...@@ -408,19 +397,6 @@ describe Environment do ...@@ -408,19 +397,6 @@ describe Environment do
let(:project) { cluster.project } let(:project) { cluster.project }
it_behaves_like 'same behavior between KubernetesService and Platform::Kubernetes' it_behaves_like 'same behavior between KubernetesService and Platform::Kubernetes'
=======
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'
>>>>>>> origin/master
end end
end end
...@@ -451,17 +427,10 @@ describe Environment do ...@@ -451,17 +427,10 @@ describe Environment do
end end
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 context 'when the environment does not have rollout status' do
before do before do
allow(environment).to receive(:has_terminals?).and_return(false) allow(environment).to receive(:has_terminals?).and_return(false)
end end
>>>>>>> origin/master
it { is_expected.to eq(nil) } it { is_expected.to eq(nil) }
end 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