Skip to content

Commit 187b8bf

Browse files
authored
FIX: Support multiple moderation groups on category (#307)
See relevant core PR: discourse/discourse#28655.
1 parent 0157a8d commit 187b8bf

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

.discourse-compatibility

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
< 3.4.0.beta2-dev: 1bbdfd8f5681171dc3f0e9ea93cd56997dc7938a
12
< 3.4.0.beta1-dev: dc1ef92be23332a54854751a23b9029463584845
23
< 3.3.0.beta2-dev: a18ce6d712fafed286bcc99543dd173110c6dfb8
34
< 3.3.0.beta1-dev: 526a44644a7b3f0c2a3ba4fc16e72f364e9fce6d

spec/integration/solved_spec.rb

+3-2
Original file line numberDiff line numberDiff line change
@@ -414,12 +414,13 @@
414414

415415
context "with group moderators" do
416416
fab!(:group_user)
417+
let!(:category_moderation_group) do
418+
Fabricate(:category_moderation_group, category: p1.topic.category, group: group_user.group)
419+
end
417420
let(:user_gm) { group_user.user }
418-
let(:group) { group_user.group }
419421

420422
before do
421423
SiteSetting.enable_category_group_moderation = true
422-
p1.topic.category.update!(reviewable_by_group_id: group.id)
423424
sign_in(user_gm)
424425
end
425426

spec/lib/guardian_extensions_spec.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@
4646
it "returns true if the user is a category group moderator for the topic" do
4747
group = Fabricate(:group)
4848
group.add(user)
49-
category = Fabricate(:category, reviewable_by_group_id: group.id)
49+
category = Fabricate(:category)
50+
Fabricate(:category_moderation_group, category:, group:)
5051
topic.update!(category: category)
5152
SiteSetting.enable_category_group_moderation = true
5253
expect(guardian.can_accept_answer?(topic, post)).to eq(true)

0 commit comments

Comments
 (0)