mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-15 07:00:33 +08:00
22 lines
855 B
Ruby
22 lines
855 B
Ruby
# 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
|
|
|
|
it "renables themes" do
|
|
SystemThemesManager.sync!
|
|
Theme.horizon_theme.update_column(:enabled, false)
|
|
SystemThemesManager.sync!
|
|
expect(Theme.horizon_theme.reload.enabled).to be true
|
|
end
|
|
end
|