mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-27 13:45:29 +08:00
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`
15 lines
649 B
Ruby
Vendored
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
|