mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 09:08:10 +08:00
FEATURE: Replace Lounge with General Category (#18097)
- Seed the General category so that the general chat channel will have a home - Do not seed the Lounge category anymore - Move the "Welcome to Site" topic to the General category
This commit is contained in:
@ -158,13 +158,13 @@ RSpec.describe SeedData::Categories do
|
||||
describe "#reseed_options" do
|
||||
it "returns only existing categories as options" do
|
||||
create_category("meta_category_id")
|
||||
create_category("lounge_category_id")
|
||||
create_category("general_category_id")
|
||||
Post.last.revise(Fabricate(:admin), raw: "Hello world")
|
||||
|
||||
expected_options = [
|
||||
{ id: "uncategorized_category_id", name: I18n.t("uncategorized_category_name"), selected: true },
|
||||
{ id: "meta_category_id", name: I18n.t("meta_category_name"), selected: true },
|
||||
{ id: "lounge_category_id", name: I18n.t("vip_category_name"), selected: false }
|
||||
{ id: "general_category_id", name: I18n.t("general_category_name"), selected: false }
|
||||
]
|
||||
|
||||
expect(subject.reseed_options).to eq(expected_options)
|
||||
|
@ -5,6 +5,11 @@ require 'seed_data/topics'
|
||||
RSpec.describe SeedData::Topics do
|
||||
subject { SeedData::Topics.with_default_locale }
|
||||
|
||||
before do
|
||||
general_category = Fabricate(:category, name: "General")
|
||||
SiteSetting.general_category_id = general_category.id
|
||||
end
|
||||
|
||||
def create_topic(name = "welcome_topic_id")
|
||||
subject.create(site_setting_names: [name])
|
||||
end
|
||||
@ -18,7 +23,7 @@ RSpec.describe SeedData::Topics do
|
||||
topic = Topic.last
|
||||
expect(topic.title).to eq(I18n.t("discourse_welcome_topic.title"))
|
||||
expect(topic.first_post.raw).to eq(I18n.t('discourse_welcome_topic.body', base_path: Discourse.base_path).rstrip)
|
||||
expect(topic.category_id).to eq(SiteSetting.uncategorized_category_id)
|
||||
expect(topic.category_id).to eq(SiteSetting.general_category_id)
|
||||
expect(topic.user_id).to eq(Discourse::SYSTEM_USER_ID)
|
||||
expect(topic.pinned_globally).to eq(true)
|
||||
expect(topic.pinned_at).to be_present
|
||||
|
Reference in New Issue
Block a user