Commit 49fdb7f3 authored by Thong Kuah's avatar Thong Kuah

Remove usages of pipeline.environments in specs

This pipeline.environments association creates cross-db queries, so
should be removed eventually
parent da5542a6
......@@ -3524,7 +3524,7 @@ RSpec.describe MergeRequest, factory_default: :keep do
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
......
......@@ -185,7 +185,7 @@ RSpec.describe Environments::StopService do
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
......@@ -196,7 +196,7 @@ RSpec.describe Environments::StopService do
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
......@@ -208,7 +208,7 @@ RSpec.describe Environments::StopService do
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
......@@ -232,7 +232,7 @@ RSpec.describe Environments::StopService do
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
......
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