mirror of
https://github.com/discourse/discourse.git
synced 2025-02-21 18:33:28 +08:00
DEV: Remove experimental_topics_filter
setting
This commit is contained in:
parent
d880db3b7b
commit
3c1f8f5d9d
@ -126,8 +126,6 @@ class ListController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def filter
|
def filter
|
||||||
raise Discourse::NotFound if !SiteSetting.experimental_topics_filter
|
|
||||||
|
|
||||||
topic_query_opts = { no_definitions: !SiteSetting.show_category_definitions_in_topic_lists }
|
topic_query_opts = { no_definitions: !SiteSetting.show_category_definitions_in_topic_lists }
|
||||||
|
|
||||||
%i[page q].each do |key|
|
%i[page q].each do |key|
|
||||||
|
@ -693,7 +693,7 @@ RSpec.configure do |config|
|
|||||||
|
|
||||||
RspecErrorTracker.exceptions.each_with_index do |(path, ex), index|
|
RspecErrorTracker.exceptions.each_with_index do |(path, ex), index|
|
||||||
lines << "\n"
|
lines << "\n"
|
||||||
lines << "Error encountered while proccessing #{path}"
|
lines << "Error encountered while processing #{path}"
|
||||||
lines << " #{ex.class}: #{ex.message}"
|
lines << " #{ex.class}: #{ex.message}"
|
||||||
ex.backtrace.each_with_index do |line, backtrace_index|
|
ex.backtrace.each_with_index do |line, backtrace_index|
|
||||||
if ENV["RSPEC_EXCLUDE_GEMS_IN_BACKTRACE"]
|
if ENV["RSPEC_EXCLUDE_GEMS_IN_BACKTRACE"]
|
||||||
|
@ -1321,8 +1321,6 @@ RSpec.describe ListController do
|
|||||||
fab!(:private_message_topic)
|
fab!(:private_message_topic)
|
||||||
fab!(:topic_in_private_category) { Fabricate(:topic, category: private_category) }
|
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
|
it "should not return topics that the user is not allowed to view" do
|
||||||
sign_in(user)
|
sign_in(user)
|
||||||
|
|
||||||
@ -1345,16 +1343,6 @@ RSpec.describe ListController do
|
|||||||
).to contain_exactly(topic.id)
|
).to contain_exactly(topic.id)
|
||||||
end
|
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
|
it "returns category definition topics if `show_category_definitions_in_topic_lists` site setting is enabled" do
|
||||||
category_topic = Fabricate(:topic, category: category)
|
category_topic = Fabricate(:topic, category: category)
|
||||||
category.update!(topic: category_topic)
|
category.update!(topic: category_topic)
|
||||||
|
@ -6,29 +6,21 @@ describe "Filtering topics", type: :system do
|
|||||||
let(:topic_query_filter) { PageObjects::Components::TopicQueryFilter.new }
|
let(:topic_query_filter) { PageObjects::Components::TopicQueryFilter.new }
|
||||||
let(:sidebar) { PageObjects::Components::NavigationMenu::Sidebar.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
|
it "updates the input field when the query string is changed" do
|
||||||
sidebar_section = Fabricate(:sidebar_section, user: user)
|
sidebar_section = Fabricate(:sidebar_section, user: user)
|
||||||
|
|
||||||
sidebar_section_link_1 =
|
Fabricate(
|
||||||
Fabricate(
|
:sidebar_section_link,
|
||||||
:sidebar_section_link,
|
sidebar_section: sidebar_section,
|
||||||
sidebar_section: sidebar_section,
|
linkable: Fabricate(:sidebar_url, name: "filter tags", value: "/filter?q=tag%3Atag1"),
|
||||||
linkable: Fabricate(:sidebar_url, name: "filter tags", value: "/filter?q=tag%3Atag1"),
|
)
|
||||||
)
|
|
||||||
|
|
||||||
sidebar_section_link_2 =
|
Fabricate(
|
||||||
Fabricate(
|
:sidebar_section_link,
|
||||||
:sidebar_section_link,
|
sidebar_section: sidebar_section,
|
||||||
sidebar_section: sidebar_section,
|
linkable:
|
||||||
linkable:
|
Fabricate(:sidebar_url, name: "filter categories", value: "/filter?q=category%3Acategory1"),
|
||||||
Fabricate(
|
)
|
||||||
:sidebar_url,
|
|
||||||
name: "filter categories",
|
|
||||||
value: "/filter?q=category%3Acategory1",
|
|
||||||
),
|
|
||||||
)
|
|
||||||
|
|
||||||
sign_in(user)
|
sign_in(user)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user