diff --git a/app/models/javascript_cache.rb b/app/models/javascript_cache.rb index b5dca967ea2..85a31c94c4e 100644 --- a/app/models/javascript_cache.rb +++ b/app/models/javascript_cache.rb @@ -12,7 +12,7 @@ class JavascriptCache < ActiveRecord::Base end def local_url - "#{Discourse.base_path}/#{path}" + "#{Discourse.base_path}#{path}" end private diff --git a/spec/models/theme_field_spec.rb b/spec/models/theme_field_spec.rb index 9c26ac49315..8b99f55ef2c 100644 --- a/spec/models/theme_field_spec.rb +++ b/spec/models/theme_field_spec.rb @@ -504,6 +504,7 @@ HTML expect(val["theme_uploads"]["test_js"]).to eq(js_field.upload.url) expect(val["theme_uploads_local"]["test_js"]).to eq(js_field.javascript_cache.local_url) + expect(val["theme_uploads_local"]["test_js"]).to start_with("/theme-javascripts/") end