FEATURE: Add site setting and wizard step to set base font (#10250)

Co-authored-by: Neil Lalonde <neillalonde@gmail.com>
This commit is contained in:
Bianca Nenciu
2020-08-31 13:14:09 +03:00
committed by GitHub
parent 7290ca1f4a
commit f2e14a3946
29 changed files with 404 additions and 60 deletions

View File

@@ -167,6 +167,16 @@ describe Wizard::StepUpdater do
end
end
context "fonts step" do
it "updates the font" do
updater = wizard.create_updater('fonts', font_previews: 'open_sans')
updater.update
expect(updater.success?).to eq(true)
expect(wizard.completed_steps?('fonts')).to eq(true)
expect(SiteSetting.base_font).to eq('open_sans')
end
end
context "colors step" do
context "with an existing color scheme" do
fab!(:color_scheme) { Fabricate(:color_scheme, name: 'existing', via_wizard: true) }

View File

@@ -41,6 +41,15 @@ describe Wizard::Builder do
expect(invites_step.disabled).to be_truthy
end
context 'fonts step' do
let(:fonts_step) { wizard.steps.find { |s| s.id == 'fonts' } }
let(:field) { fonts_step.fields.first }
it 'should set the right font' do
expect(field.choices.size).to eq(DiscourseFonts.fonts.size)
end
end
context 'logos step' do
let(:logos_step) { wizard.steps.find { |s| s.id == 'logos' } }