Module: QunitHelper

Defined in:
app/helpers/qunit_helper.rb

Instance Method Summary collapse

Instance Method Details

#theme_testsObject



4
5
6
7
8
9
10
11
12
13
14
15
# File 'app/helpers/qunit_helper.rb', line 4

def theme_tests
  theme = Theme.find_by(id: request.env[:resolved_theme_id])
  return "" if theme.blank?

  _, digest = theme.baked_js_tests_with_digest
  src =
    "#{GlobalSetting.cdn_url}" \
      "#{Discourse.base_path}" \
      "/theme-javascripts/tests/#{theme.id}-#{digest}.js" \
      "?__ws=#{Discourse.current_hostname}"
  "<script defer src='#{src}' data-theme-id='#{theme.id}'></script>".html_safe
end