mirror of
https://github.com/discourse/discourse.git
synced 2026-08-12 05:55:39 -05:00
FIX: uploading an image as a site setting
When uploading an image as a site setting, we need to return the "raw" URL, otherwise
when saving the site setting, the upload won't be looked up properly.
Follow-up-to: f11363d446
This commit is contained in:
@@ -42,6 +42,13 @@ describe UploadsController do
|
||||
expect(Jobs::CreateAvatarThumbnails.jobs.size).to eq(1)
|
||||
end
|
||||
|
||||
it 'returns "raw" url for site settings' do
|
||||
set_cdn_url "https://awesome.com"
|
||||
post "/uploads.json", params: { file: logo, type: "site_setting", for_site_setting: "true" }
|
||||
expect(response.status).to eq 200
|
||||
expect(response.parsed_body["url"]).to start_with("/uploads/default/")
|
||||
end
|
||||
|
||||
it 'returns cdn url' do
|
||||
set_cdn_url "https://awesome.com"
|
||||
post "/uploads.json", params: { file: logo, type: "composer" }
|
||||
|
||||
Reference in New Issue
Block a user