FIX: When running the wizard and using a custom theme, fallback to the color_scheme name if the base_scheme_id is nil (#8236)

This commit is contained in:
Roman Rizzi
2019-10-25 09:29:51 -03:00
committed by GitHub
parent 5ae35f9906
commit 070a3dcf9b
3 changed files with 32 additions and 8 deletions

View File

@@ -162,7 +162,21 @@ describe Wizard::Builder do
end
end
describe "when the default them hass been override" do
describe "when the default theme has been override and the color scheme doesn't have a base scheme" do
let(:color_scheme) { Fabricate(:color_scheme, base_scheme_id: nil) }
before do
SiteSetting.default_theme_id = theme.id
theme.update(color_scheme: color_scheme)
end
it 'fallbacks to the color scheme name' do
expect(field.required).to eq(false)
expect(field.value).to eq(color_scheme.name)
end
end
describe "when the default theme has been override" do
before do
theme.set_default!
end