summaryrefslogtreecommitdiff
path: root/spec/models/environment_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/environment_spec.rb')
-rw-r--r--spec/models/environment_spec.rb66
1 files changed, 0 insertions, 66 deletions
diff --git a/spec/models/environment_spec.rb b/spec/models/environment_spec.rb
index e3e9d1f7a71..08c639957d3 100644
--- a/spec/models/environment_spec.rb
+++ b/spec/models/environment_spec.rb
@@ -801,38 +801,6 @@ RSpec.describe Environment, :use_clean_rails_memory_store_caching do
expect(query_count).to eq(0)
end
end
-
- context 'when the feature for disable_join is disabled' do
- let(:pipeline) { create(:ci_pipeline, project: project) }
- let(:ci_build) { create(:ci_build, project: project, pipeline: pipeline) }
-
- before do
- stub_feature_flags(environment_last_visible_pipeline_disable_joins: false)
- create(:deployment, :failed, project: project, environment: environment, deployable: ci_build)
- end
-
- context 'for preload' do
- it 'executes the original association instead of override' do
- environment.reload
- ActiveRecord::Associations::Preloader.new.preload(environment, [last_visible_deployable: []])
-
- expect_any_instance_of(Deployment).not_to receive(:deployable)
-
- query_count = ActiveRecord::QueryRecorder.new do
- expect(subject.id).to eq(ci_build.id)
- end.count
-
- expect(query_count).to eq(0)
- end
- end
-
- context 'for direct call' do
- it 'executes the original association instead of override' do
- expect_any_instance_of(Deployment).not_to receive(:deployable)
- expect(subject.id).to eq(ci_build.id)
- end
- end
- end
end
describe '#last_visible_pipeline' do
@@ -963,40 +931,6 @@ RSpec.describe Environment, :use_clean_rails_memory_store_caching do
expect(query_count).to eq(0)
end
end
-
- context 'when the feature for disable_join is disabled' do
- let(:pipeline) { create(:ci_pipeline, project: project) }
- let(:ci_build) { create(:ci_build, project: project, pipeline: pipeline) }
-
- before do
- stub_feature_flags(environment_last_visible_pipeline_disable_joins: false)
- create(:deployment, :failed, project: project, environment: environment, deployable: ci_build)
- end
-
- subject { environment.last_visible_pipeline }
-
- context 'for preload' do
- it 'executes the original association instead of override' do
- environment.reload
- ActiveRecord::Associations::Preloader.new.preload(environment, [last_visible_pipeline: []])
-
- expect_any_instance_of(Ci::Build).not_to receive(:pipeline)
-
- query_count = ActiveRecord::QueryRecorder.new do
- expect(subject.id).to eq(pipeline.id)
- end.count
-
- expect(query_count).to eq(0)
- end
- end
-
- context 'for direct call' do
- it 'executes the original association instead of override' do
- expect_any_instance_of(Ci::Build).not_to receive(:pipeline)
- expect(subject.id).to eq(pipeline.id)
- end
- end
- end
end
describe '#upcoming_deployment' do