esl / MongoosePush

MongoosePush is a simple Elixir RESTful service allowing to send push notification via FCM and/or APNS.
Apache License 2.0
108 stars 24 forks source link

Openapi property based testing #172

Closed leszke closed 4 years ago

leszke commented 4 years ago

This PR introduces property-based approach to APIv3 testing, with a little help of StreamData framework. I also incorporated the fix/enhancement of 'the hack of the hack' introduced in #168. Shortly speaking, the request containing, from the needed fields, only data, alert/body and alert/title fields, was matched against SilentNotification schema, what has been leading to improper Unexpected field: alert error.

I also improved ControllersHelper.missing_field_response helper function to better reflect possible error messages we can encounter during tests, basing on the API version being used.

DenysGonchar commented 4 years ago

looks good. please recheck Nelson's suggestion.