diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-20 13:43:29 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-20 13:43:29 +0300 |
commit | 3b1af5cc7ed2666ff18b718ce5d30fa5a2756674 (patch) | |
tree | 3bc4a40e0ee51ec27eabf917c537033c0c5b14d4 /spec/finders/deployments_finder_spec.rb | |
parent | 9bba14be3f2c211bf79e15769cd9b77bc73a13bc (diff) |
Add latest changes from gitlab-org/gitlab@16-1-stable-eev16.1.0-rc42
Diffstat (limited to 'spec/finders/deployments_finder_spec.rb')
-rw-r--r-- | spec/finders/deployments_finder_spec.rb | 48 |
1 files changed, 3 insertions, 45 deletions
diff --git a/spec/finders/deployments_finder_spec.rb b/spec/finders/deployments_finder_spec.rb index 86b6070a368..517fa0e2c7a 100644 --- a/spec/finders/deployments_finder_spec.rb +++ b/spec/finders/deployments_finder_spec.rb @@ -249,53 +249,11 @@ RSpec.describe DeploymentsFinder do end end - describe 'enforce sorting to `updated_at` sorting' do + context 'when `updated_at` is used for filtering without sorting by `updated_at`' do let(:params) { { **base_params, updated_before: 1.day.ago, order_by: 'id', sort: 'asc' } } - context 'when the deployments_raise_updated_at_inefficient_error FF is disabled' do - before do - stub_feature_flags(deployments_raise_updated_at_inefficient_error: false) - end - - it 'sorts by only one column' do - expect(subject.order_values.size).to eq(2) - end - - it 'sorts by `updated_at`' do - expect(subject.order_values.first.to_sql).to eq(Deployment.arel_table[:updated_at].asc.to_sql) - expect(subject.order_values.second.to_sql).to eq(Deployment.arel_table[:id].asc.to_sql) - end - end - - context 'when the deployments_raise_updated_at_inefficient_error FF is enabled' do - before do - stub_feature_flags(deployments_raise_updated_at_inefficient_error: true) - end - - context 'when the flag is overridden' do - before do - stub_feature_flags(deployments_raise_updated_at_inefficient_error_override: true) - end - - it 'sorts by only one column' do - expect(subject.order_values.size).to eq(2) - end - - it 'sorts by `updated_at`' do - expect(subject.order_values.first.to_sql).to eq(Deployment.arel_table[:updated_at].asc.to_sql) - expect(subject.order_values.second.to_sql).to eq(Deployment.arel_table[:id].asc.to_sql) - end - end - - context 'when the flag is not overridden' do - before do - stub_feature_flags(deployments_raise_updated_at_inefficient_error_override: false) - end - - it 'raises an error' do - expect { subject }.to raise_error(DeploymentsFinder::InefficientQueryError) - end - end + it 'raises an error' do + expect { subject }.to raise_error(DeploymentsFinder::InefficientQueryError) end end |