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:
Blake Erickson
2022-08-29 13:05:41 -06:00
committed by GitHub
parent e16c8ea2e7
commit eba8b8d34d
6 changed files with 24 additions and 56 deletions

View File

@ -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)

View File

@ -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