mirror of
https://github.com/discourse/discourse.git
synced 2024-12-15 00:23:49 +08:00
0f1afad6da
* FIX: extracted theme javascripts for multisite * onceoff to rebake all theme fields
16 lines
489 B
Ruby
16 lines
489 B
Ruby
require 'rails_helper'
|
|
|
|
describe Jobs::RebakeAllHtmlThemeFields do
|
|
let(:theme) { Fabricate(:theme) }
|
|
let(:theme_field) { ThemeField.create!(theme: theme, target_id: 0, name: "header", value: "<script>console.log(123)</script>") }
|
|
|
|
it 'extracts inline javascripts' do
|
|
theme_field.update_attributes(value_baked: 'need to be rebaked')
|
|
|
|
described_class.new.execute_onceoff({})
|
|
|
|
theme_field.reload
|
|
expect(theme_field.value_baked).to include('theme-javascripts')
|
|
end
|
|
end
|