FIX: add protection for scss removal during upgrade

In some cases plugins would remove scss files or change them, but CSS
was still calculated based off stale data in old instance cache
This commit is contained in:
Sam
2018-05-31 17:02:27 +10:00
parent be28154d3b
commit 5086fdc76d
2 changed files with 36 additions and 1 deletions

View File

@ -65,6 +65,30 @@ describe Stylesheet::Manager do
expect(new_link).to include("/stylesheets/desktop_theme_#{theme.id}_")
end
describe 'digest' do
after do
DiscoursePluginRegistry.stylesheets.delete "fake_file"
end
it 'can correctly account for plugins in digest' do
theme = Theme.create!(
name: 'parent',
user_id: -1
)
manager = Stylesheet::Manager.new(:desktop_theme, theme.key)
digest1 = manager.digest
DiscoursePluginRegistry.stylesheets.add "fake_file"
manager = Stylesheet::Manager.new(:desktop_theme, theme.key)
digest2 = manager.digest
expect(digest1).not_to eq(digest2)
end
end
describe 'color_scheme_digest' do
it "changes with category background image" do
theme = Theme.new(