mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 07:37:55 +08:00
Trim WebHookUserSerializer
.
This commit is contained in:
@ -18,4 +18,21 @@ RSpec.describe WebHookUserSerializer do
|
||||
expect(payload[:email]).to eq(user.email)
|
||||
expect(payload[:external_id]).to eq('12345')
|
||||
end
|
||||
|
||||
it 'should only include the required keys' do
|
||||
count = serializer.as_json.keys.count
|
||||
difference = count - 42
|
||||
|
||||
expect(difference).to eq(0), lambda {
|
||||
message = ""
|
||||
|
||||
if difference < 0
|
||||
message << "#{difference * -1} key(s) have been removed from this serializer."
|
||||
else
|
||||
message << "#{difference} key(s) have been added to this serializer."
|
||||
end
|
||||
|
||||
message << "\nPlease verify if those key(s) are required as part of the web hook's payload."
|
||||
}
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user