FEATURE: out-of-the-box dark/light user selectable themes

This commit is contained in:
Sam
2017-05-03 11:31:16 -04:00
parent 81190f5d66
commit 342ef5f81a
13 changed files with 68 additions and 35 deletions

View File

@ -4,6 +4,7 @@ require 'stylesheet/compiler'
describe Stylesheet::Manager do
it 'does not crash for missing theme' do
Theme.clear_default!
link = Stylesheet::Manager.stylesheet_link_tag(:embedded_theme)
expect(link).to eq("")

View File

@ -155,17 +155,14 @@ describe Wizard::StepUpdater do
updater.update
expect(updater.success?).to eq(true)
expect(wizard.completed_steps?('colors')).to eq(true)
theme = Theme.find_by(key: SiteSetting.default_theme_key)
expect(theme.color_scheme_id).to eq(color_scheme.id)
expect(theme.color_scheme.base_scheme_id).to eq('dark')
end
end
context "without an existing scheme" do
it "creates the scheme" do
updater = wizard.create_updater('colors', base_scheme_id: 'dark')
updater = wizard.create_updater('colors', base_scheme_id: 'dark', allow_dark_light_selection: true)
updater.update
expect(updater.success?).to eq(true)
expect(wizard.completed_steps?('colors')).to eq(true)
@ -176,6 +173,8 @@ describe Wizard::StepUpdater do
theme = Theme.find_by(key: SiteSetting.default_theme_key)
expect(theme.color_scheme_id).to eq(color_scheme.id)
expect(Theme.where(user_selectable: true).count).to eq(2)
end
end
end