discourse/spec/jobs/rebake_all_html_theme_fields_spec.rb
Kyle Zhao 0f1afad6da FIX: extracted theme JavaScripts for multisite (#6502)
* FIX: extracted theme javascripts for multisite

* onceoff to rebake all theme fields
2018-10-18 17:05:34 +11:00

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