mirror of
https://github.com/discourse/discourse.git
synced 2025-06-02 16:12:05 +08:00
FIX: Use CDN urls for theme uploads (#12769)
This commit is contained in:
@ -518,6 +518,19 @@ HTML
|
||||
expect(json["theme_uploads"]["bob"]).to eq(upload.url)
|
||||
end
|
||||
|
||||
it 'uses CDN url for theme_uploads in settings' do
|
||||
set_cdn_url("http://cdn.localhost")
|
||||
Theme.destroy_all
|
||||
|
||||
upload = UploadCreator.new(file_from_fixtures("logo.png"), "logo.png").create_for(-1)
|
||||
theme.set_field(type: :theme_upload_var, target: :common, name: "bob", upload_id: upload.id)
|
||||
theme.save!
|
||||
|
||||
json = JSON.parse(cached_settings(theme.id))
|
||||
|
||||
expect(json["theme_uploads"]["bob"]).to eq("http://cdn.localhost#{upload.url}")
|
||||
end
|
||||
|
||||
it 'handles settings cache correctly' do
|
||||
Theme.destroy_all
|
||||
|
||||
|
Reference in New Issue
Block a user