Simplify theme and color scheme seeding (#10872)

Now that we have support for user-selectable color schemes, it makes sense
to simplify seeding and theme updates in the wizard. 

We now:

- seed only one theme, named "Default" (previously "Light")
- seed a user-selectable Dark color scheme
- rename the "Themes" wizard step to "Colors"
- update the default theme's color scheme if a default is set
(a new theme is created if there is no default)
This commit is contained in:
Penar Musaraj
2020-10-14 10:18:02 -04:00
committed by GitHub
parent d77e31b7e9
commit 74de7a49f5
8 changed files with 35 additions and 40 deletions

View File

@ -450,12 +450,16 @@ describe ApplicationHelper do
end
describe "dark_color_scheme?" do
it 'returns nil for the base color scheme' do
it 'returns false for the base color scheme' do
expect(helper.dark_color_scheme?).to eq(false)
end
it 'works correctly for a dark scheme' do
dark_theme = Theme.where(name: "Dark").first
dark_theme = Theme.create(
name: "Dark",
user_id: -1,
color_scheme_id: ColorScheme.find_by(base_scheme_id: "Dark").id
)
helper.request.env[:resolved_theme_ids] = [dark_theme.id]
expect(helper.dark_color_scheme?).to eq(true)