mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 15:28:37 +08:00
DEV: Make user field validation more specific (#16746)
- Only validate if custom_fields are loaded, so that we don't trigger a db query - Only validate public user fields, not all custom_fields This commit also reverts the unrelated spec changes in ba148e08, which were required to work around these issues
This commit is contained in:
@ -289,9 +289,9 @@ describe UserAnonymizer do
|
||||
"user_field_#{field2.id}": "bar",
|
||||
"another_field": "456"
|
||||
}
|
||||
user.save
|
||||
|
||||
expect { make_anonymous }.to change { user.reload.custom_fields }.to "some_field" => "123", "another_field" => "456"
|
||||
expect { make_anonymous }.to change { user.custom_fields }
|
||||
expect(user.reload.custom_fields).to eq("some_field" => "123", "another_field" => "456")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user