mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 13:51:18 +08:00
FIX: TopicSummarization workaround for Postgres' discrete range types (#23105)
Our code assumed the content_range interval was inclusive, but they are open-ended due to Postgres' [discrete range types](https://www.postgresql.org/docs/current/rangetypes.html#RANGETYPES-DISCRETE), meaning [1,2] will be represented as [1,3). It also fixes some flaky tests due to test data not being correctly setup and the registry not being resetted after each test.
This commit is contained in:
@ -10,11 +10,13 @@ describe Summarization::Base do
|
||||
before do
|
||||
group.add(user)
|
||||
|
||||
strategy = DummyCustomSummarization.new("dummy")
|
||||
strategy = DummyCustomSummarization.new({ summary: "dummy", chunks: [] })
|
||||
plugin.register_summarization_strategy(strategy)
|
||||
SiteSetting.summarization_strategy = strategy.model
|
||||
end
|
||||
|
||||
after { DiscoursePluginRegistry.reset_register!(:summarization_strategies) }
|
||||
|
||||
describe "#can_see_summary?" do
|
||||
context "when the user cannot generate a summary" do
|
||||
before { SiteSetting.custom_summarization_allowed_groups = "" }
|
||||
|
Reference in New Issue
Block a user