I have a Rails application which has a MySQL database. An external service goes to the MySQL and gets some data, mash it up with some other data he has in its own database, and populates it in a DB.
That external service provides an API which I can consume and get data from it.
What is the proper way to write specs so that I know that:
The data they are returning is the proper one. So, since I know what is the state of my DB, I know that if I query a specific endpoint with specific parameters, some data should be returned.
I have the specs for the format of the data, but I am unsure on how to write the specs on the data that is returned. What kind of specs I am looking for here?
I have read about consumer driven contracts, but I fail to see how would I write tests for it.
Aucun commentaire:
Enregistrer un commentaire