From e6fdfcdcd25d4bf7f009079cace41d0e9ffe4791 Mon Sep 17 00:00:00 2001 From: Penar Musaraj Date: Mon, 25 Nov 2024 10:49:40 -0500 Subject: [PATCH] DEV: Remove `experimental_topics_filter` setting (#29902) --- app/controllers/list_controller.rb | 2 -- spec/rails_helper.rb | 2 +- spec/requests/list_controller_spec.rb | 12 ----------- spec/system/filtering_topics_spec.rb | 30 ++++++++++----------------- 4 files changed, 12 insertions(+), 34 deletions(-) diff --git a/app/controllers/list_controller.rb b/app/controllers/list_controller.rb index 89e602605eb..77ed9bf9aa4 100644 --- a/app/controllers/list_controller.rb +++ b/app/controllers/list_controller.rb @@ -126,8 +126,6 @@ class ListController < ApplicationController end def filter - raise Discourse::NotFound if !SiteSetting.experimental_topics_filter - topic_query_opts = { no_definitions: !SiteSetting.show_category_definitions_in_topic_lists } %i[page q].each do |key| diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index 43fbeb12bbd..dd30745bbe2 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -693,7 +693,7 @@ RSpec.configure do |config| RspecErrorTracker.exceptions.each_with_index do |(path, ex), index| lines << "\n" - lines << "Error encountered while proccessing #{path}" + lines << "Error encountered while processing #{path}" lines << " #{ex.class}: #{ex.message}" ex.backtrace.each_with_index do |line, backtrace_index| if ENV["RSPEC_EXCLUDE_GEMS_IN_BACKTRACE"] diff --git a/spec/requests/list_controller_spec.rb b/spec/requests/list_controller_spec.rb index 5d055273ee9..3aa6b61c30e 100644 --- a/spec/requests/list_controller_spec.rb +++ b/spec/requests/list_controller_spec.rb @@ -1321,8 +1321,6 @@ RSpec.describe ListController do fab!(:private_message_topic) fab!(:topic_in_private_category) { Fabricate(:topic, category: private_category) } - before { SiteSetting.experimental_topics_filter = true } - it "should not return topics that the user is not allowed to view" do sign_in(user) @@ -1345,16 +1343,6 @@ RSpec.describe ListController do ).to contain_exactly(topic.id) end - it "should respond with 404 response code when `experimental_topics_filter` site setting has not been enabled" do - SiteSetting.experimental_topics_filter = false - - sign_in(user) - - get "/filter.json" - - expect(response.status).to eq(404) - end - it "returns category definition topics if `show_category_definitions_in_topic_lists` site setting is enabled" do category_topic = Fabricate(:topic, category: category) category.update!(topic: category_topic) diff --git a/spec/system/filtering_topics_spec.rb b/spec/system/filtering_topics_spec.rb index 1d789397ae9..c5f2d03f1aa 100644 --- a/spec/system/filtering_topics_spec.rb +++ b/spec/system/filtering_topics_spec.rb @@ -6,29 +6,21 @@ describe "Filtering topics", type: :system do let(:topic_query_filter) { PageObjects::Components::TopicQueryFilter.new } let(:sidebar) { PageObjects::Components::NavigationMenu::Sidebar.new } - before { SiteSetting.experimental_topics_filter = true } - it "updates the input field when the query string is changed" do sidebar_section = Fabricate(:sidebar_section, user: user) - sidebar_section_link_1 = - Fabricate( - :sidebar_section_link, - sidebar_section: sidebar_section, - linkable: Fabricate(:sidebar_url, name: "filter tags", value: "/filter?q=tag%3Atag1"), - ) + Fabricate( + :sidebar_section_link, + sidebar_section: sidebar_section, + linkable: Fabricate(:sidebar_url, name: "filter tags", value: "/filter?q=tag%3Atag1"), + ) - sidebar_section_link_2 = - Fabricate( - :sidebar_section_link, - sidebar_section: sidebar_section, - linkable: - Fabricate( - :sidebar_url, - name: "filter categories", - value: "/filter?q=category%3Acategory1", - ), - ) + Fabricate( + :sidebar_section_link, + sidebar_section: sidebar_section, + linkable: + Fabricate(:sidebar_url, name: "filter categories", value: "/filter?q=category%3Acategory1"), + ) sign_in(user)