mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: allow single string values on custom multiple select fields and not just arrays (#14236)
This commit is contained in:
@@ -1279,6 +1279,16 @@ describe UsersController do
|
||||
end
|
||||
end
|
||||
|
||||
it "should allow single values and not just arrays" do
|
||||
expect do
|
||||
put update_user_url, params: { user_fields: { field_id => 'Axe' } }
|
||||
end.to change { user.reload.user_fields[field_id] }.from(nil).to('Axe')
|
||||
|
||||
expect do
|
||||
put update_user_url, params: { user_fields: { field_id => %w[Axe Juice Sword] } }
|
||||
end.to change { user.reload.user_fields[field_id] }.from('Axe').to(%w[Axe Sword])
|
||||
end
|
||||
|
||||
it "shouldn't allow unregistered field values" do
|
||||
expect do
|
||||
put update_user_url, params: { user_fields: { field_id => %w[Juice] } }
|
||||
|
||||
Reference in New Issue
Block a user