mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 11:26:28 +08:00
FIX: Abort theme creation if unable to create uploads (#16336)
Previous to this change if any of the assets were not allowed extensions they would simply be silently ignored, this could lead to broken themes that are very hard to debug
This commit is contained in:
@ -151,6 +151,16 @@ describe Admin::ThemesController do
|
||||
expect(UserHistory.where(action: UserHistory.actions[:change_theme]).count).to eq(1)
|
||||
end
|
||||
|
||||
it 'fails to import with an error if uploads are not allowed' do
|
||||
SiteSetting.theme_authorized_extensions = "nothing"
|
||||
|
||||
expect do
|
||||
post "/admin/themes/import.json", params: { theme: theme_archive }
|
||||
end.to change { Theme.count }.by (0)
|
||||
|
||||
expect(response.status).to eq(422)
|
||||
end
|
||||
|
||||
it 'imports a theme from an archive' do
|
||||
_existing_theme = Fabricate(:theme, name: "Header Icons")
|
||||
|
||||
|
Reference in New Issue
Block a user