DEV: Convert min_trust_to_flag_posts setting to groups (#24864)

We're changing the implementation of trust levels to use groups. Part of this is to have site settings that reference trust levels use groups instead. It converts the min_trust_to_flag_posts site setting to flag_post_allowed_groups.

Note: In the original setting, "posts" is plural. I have changed this to "post" singular in the new setting to match others.
This commit is contained in:
Ted Johansson
2023-12-13 17:18:42 +08:00
committed by GitHub
parent 36057638ca
commit 294febf3c4
37 changed files with 151 additions and 84 deletions

View File

@@ -6,7 +6,7 @@ RSpec.describe Jobs::AutoQueueHandler do
describe "old flagged post" do
fab!(:spam_result) do
PostActionCreator.new(
Fabricate(:user),
Fabricate(:user, refresh_auto_groups: true),
Fabricate(:post),
PostActionType.types[:spam],
message: "this is the initial message",

View File

@@ -3,7 +3,7 @@
require "csv"
RSpec.describe Jobs::ExportUserArchive do
fab!(:user) { Fabricate(:user, username: "john_doe") }
fab!(:user) { Fabricate(:user, username: "john_doe", refresh_auto_groups: true) }
fab!(:user2) { Fabricate(:user) }
let(:extra) { {} }
let(:job) do

View File

@@ -5,7 +5,7 @@ RSpec.describe Jobs::PendingReviewablesReminder do
def create_flag(created_at)
PostActionCreator.create(
Fabricate(:user),
Fabricate(:user, refresh_auto_groups: true),
Fabricate(:post),
:spam,
created_at: created_at,

View File

@@ -1,8 +1,8 @@
# frozen_string_literal: true
RSpec.describe Jobs::TruncateUserFlagStats do
fab!(:user)
fab!(:other_user) { Fabricate(:user) }
fab!(:user) { Fabricate(:user, refresh_auto_groups: true) }
fab!(:other_user) { Fabricate(:user, refresh_auto_groups: true) }
before do
# We might make this a site setting eventually