Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/environment_status_spec.rb')
-rw-r--r--spec/models/environment_status_spec.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/models/environment_status_spec.rb b/spec/models/environment_status_spec.rb
index 09a73a4cdcb..1b9b38a0932 100644
--- a/spec/models/environment_status_spec.rb
+++ b/spec/models/environment_status_spec.rb
@@ -245,6 +245,17 @@ RSpec.describe EnvironmentStatus do
end
end
+ context 'when there is a deployment in a child pipeline' do
+ let!(:child_pipeline) { create(:ci_pipeline, child_of: pipeline) }
+ let!(:child_build) { create(:ci_build, :with_deployment, :start_review_app, pipeline: child_pipeline) }
+ let(:child_environment) { child_build.deployment.environment }
+
+ it 'returns both parent and child entries' do
+ expect(subject.count).to eq(2)
+ expect(subject.map(&:id)).to contain_exactly(environment.id, child_environment.id)
+ end
+ end
+
context 'when environment is stopped' do
before do
environment.stop!