mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 21:35:48 +08:00
b72282123b
Before, public sidebar sections were belonging to admin. However, a better choice is system user.
13 lines
387 B
Ruby
13 lines
387 B
Ruby
# 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
|