mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 05:53:52 +08:00
FIX: public sidebar sections belong to system user (#20972)
Before, public sidebar sections were belonging to admin. However, a better choice is system user.
This commit is contained in:

committed by
GitHub

parent
6b9dd22ba7
commit
b72282123b
12
spec/models/sidebar_section_spec.rb
Normal file
12
spec/models/sidebar_section_spec.rb
Normal file
@ -0,0 +1,12 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
RSpec.describe SidebarSection do
|
||||
fab!(:user) { Fabricate(:user) }
|
||||
fab!(:sidebar_section) { Fabricate(:sidebar_section, user: user) }
|
||||
|
||||
it "uses system user for public sections" do
|
||||
expect(sidebar_section.user_id).to eq(user.id)
|
||||
sidebar_section.update!(public: true)
|
||||
expect(sidebar_section.user_id).to eq(Discourse.system_user.id)
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user