Skip to content
Snippets Groups Projects
Commit 49fdb7f3 authored by Thong Kuah's avatar Thong Kuah :speech_balloon:
Browse files

Remove usages of pipeline.environments in specs

This pipeline.environments association creates cross-db queries, so
should be removed eventually
parent da5542a6
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -3524,7 +3524,7 @@ def set_compare(merge_request)
let!(:job) { create(:ci_build, :with_deployment, :start_review_app, pipeline: pipeline, project: project) }
 
it 'returns environments' do
is_expected.to eq(pipeline.environments)
is_expected.to eq(pipeline.environments_in_self_and_descendants.to_a)
expect(subject.count).to be(1)
end
 
Loading
Loading
Loading
Loading
@@ -185,7 +185,7 @@
end
 
it 'has active environment at first' do
expect(pipeline.environments.first).to be_available
expect(pipeline.environments_in_self_and_descendants.first).to be_available
end
 
context 'when user is a developer' do
Loading
Loading
@@ -196,7 +196,7 @@
it 'stops the active environment' do
subject
 
expect(pipeline.environments.first).to be_stopped
expect(pipeline.environments_in_self_and_descendants.first).to be_stopped
end
end
 
Loading
Loading
@@ -208,7 +208,7 @@
it 'does not stop the active environment' do
subject
 
expect(pipeline.environments.first).to be_available
expect(pipeline.environments_in_self_and_descendants.first).to be_available
end
end
 
Loading
Loading
@@ -232,7 +232,7 @@
it 'does not stop the active environment' do
subject
 
expect(pipeline.environments.first).to be_available
expect(pipeline.environments_in_self_and_descendants.first).to be_available
end
end
end
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment