mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 07:53:49 +08:00
FIX: Unable to change homepage style via wizard (#19462)
Depending on the current state of things, sometimes the homepage style wouldn't update because we were incorrectly blocking updates the `desktop_category_page_style` site setting if the first item in the top menu was 'categories'. Added a test case to handle this situation. See https://meta.discourse.org/t/248354
This commit is contained in:
@ -257,6 +257,27 @@ RSpec.describe Wizard::StepUpdater do
|
||||
expect(SiteSetting.top_menu).to eq('latest|categories|new|top')
|
||||
end
|
||||
|
||||
it "updates style even when categories is first in top menu" do
|
||||
SiteSetting.top_menu = "categories|new|latest"
|
||||
updater = wizard.create_updater('styling',
|
||||
body_font: 'arial',
|
||||
heading_font: 'arial',
|
||||
homepage_style: "categories_with_featured_topics"
|
||||
)
|
||||
updater.update
|
||||
expect(updater).to be_success
|
||||
expect(SiteSetting.desktop_category_page_style).to eq('categories_with_featured_topics')
|
||||
|
||||
updater = wizard.create_updater('styling',
|
||||
body_font: 'arial',
|
||||
heading_font: 'arial',
|
||||
homepage_style: "subcategories_with_featured_topics"
|
||||
)
|
||||
updater.update
|
||||
expect(updater).to be_success
|
||||
expect(SiteSetting.desktop_category_page_style).to eq('subcategories_with_featured_topics')
|
||||
end
|
||||
|
||||
it "does not overwrite top_menu site setting" do
|
||||
SiteSetting.top_menu = "latest|unread|unseen|categories"
|
||||
updater = wizard.create_updater('styling',
|
||||
|
Reference in New Issue
Block a user