mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 15:58:17 +08:00
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:
@ -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(
|
||||
|
Reference in New Issue
Block a user