Commit a4315e4f authored by Brett Walker's avatar Brett Walker Committed by Heinrich Lee Yu

Disable `disable_anonymous_search` in specs

This is an ops feature flag that will only be enabled in exceptional
circumstances so it's better to disable this by default so that we don't
have to update a lot of specs
parent 42fbae52
......@@ -569,14 +569,18 @@ RSpec.describe IssuesFinder do
end
context 'with anonymous user' do
let_it_be(:public_project, reload: true) { create(:project, :public, group: subgroup) }
let_it_be(:issue6, reload: true) { create(:issue, project: public_project, title: 'tanuki') }
let_it_be(:issue7, reload: true) { create(:issue, project: public_project, title: 'ikunat') }
let_it_be(:public_project) { create(:project, :public, group: subgroup) }
let_it_be(:issue6) { create(:issue, project: public_project, title: 'tanuki') }
let_it_be(:issue7) { create(:issue, project: public_project, title: 'ikunat') }
let(:search_user) { nil }
let(:params) { { search: 'tanuki' } }
context 'with disable_anonymous_search feature flag enabled' do
before do
stub_feature_flags(disable_anonymous_search: true)
end
it 'does not perform search' do
expect(issues).to contain_exactly(issue6, issue7)
end
......@@ -1281,7 +1285,7 @@ RSpec.describe IssuesFinder do
end
describe '#use_cte_for_search?' do
let(:finder) { described_class.new(user, params) }
let(:finder) { described_class.new(nil, params) }
context 'when there is no search param' do
let(:params) { { attempt_group_search_optimizations: true } }
......@@ -1300,7 +1304,7 @@ RSpec.describe IssuesFinder do
end
context 'when all conditions are met' do
context 'uses group search optimization' do
context "uses group search optimization" do
let(:params) { { search: 'foo', attempt_group_search_optimizations: true } }
it 'returns true' do
......@@ -1309,7 +1313,7 @@ RSpec.describe IssuesFinder do
end
end
context 'uses project search optimization' do
context "uses project search optimization" do
let(:params) { { search: 'foo', attempt_project_search_optimizations: true } }
it 'returns true' do
......
......@@ -305,6 +305,9 @@ RSpec.configure do |config|
# For more information check https://gitlab.com/gitlab-com/gl-infra/production/-/issues/4321
stub_feature_flags(block_issue_repositioning: false)
# This is an ops feature flag that's disabled by default
stub_feature_flags(disable_anonymous_search: false)
# Disable the refactored top nav search until there is functionality
# Can be removed once all existing functionality has been replicated
# For more information check https://gitlab.com/gitlab-org/gitlab/-/issues/339348
......
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