mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 01:08:35 +08:00
FIX: Allow deleting avatars from the selectable avatars setting (#26720)
Fixes two issues: - frontend was reloading the page when clicking-to-remove avatar - backend wasn't allowing resetting the setting by deleting all avatars
This commit is contained in:
@ -269,6 +269,13 @@ RSpec.describe Admin::SiteSettingsController do
|
||||
expect(SiteSetting.title).to eq("")
|
||||
end
|
||||
|
||||
it "allows value to be a blank string for selectable_avatars" do
|
||||
SiteSetting.selectable_avatars = [Fabricate(:image_upload)]
|
||||
put "/admin/site_settings/selectable_avatars.json", params: { selectable_avatars: "" }
|
||||
expect(response.status).to eq(200)
|
||||
expect(SiteSetting.selectable_avatars).to eq([])
|
||||
end
|
||||
|
||||
it "sanitizes integer values" do
|
||||
put "/admin/site_settings/suggested_topics.json", params: { suggested_topics: "1,000" }
|
||||
|
||||
|
Reference in New Issue
Block a user