discourse/spec/lib/system_themes_manager_spec.rb
Krzysztof Kotlarek 052cebce48
FIX: Horizon default color scheme must be user selectable (#33428)
Improvements:
- When import Horizon theme, ensure that default color scheme is marked
as `user_selectable`
- Dark version of the theme is `user_selectable` as well
- When merge remote Horizon into system Horizon, also ensure that
default color scheme is marked as `user_selectable`
2025-07-02 13:40:44 +08:00

15 lines
649 B
Ruby
Vendored

# frozen_string_literal: true
RSpec.describe SystemThemesManager do
it "is idempotent" do
Theme.delete_all
expect { SystemThemesManager.sync! }.to change { Theme.system.count }.by(2)
expect { SystemThemesManager.sync! }.not_to change { Theme.count }
expect(Theme.horizon_theme.color_scheme.user_selectable).to be true
expect(
Theme.horizon_theme.color_schemes.where(name: "Horizon Dark").first.user_selectable,
).to be true
expect(Theme.horizon_theme.color_schemes.where(user_selectable: true).count).to eq(2)
expect(Theme.horizon_theme.color_schemes.where(user_selectable: false).count).to eq(10)
end
end