Red Hat Bugzilla – Bug 869500
RFE: "Hello world" objects for REST client integration testing
Last modified: 2014-10-26 21:13:56 EDT
For unit testing applications (and especially libraries) that talk to the PressGang REST API, a set of "Hello world" objects would be extremely useful.
These objects would be guaranteed to be present on every instance of PressGang from the point of new installation. This enables automated testing against any
The Hello world objects would be things like:
A topic with a specific ID, and a specific number of revisions with fixed numbers.
A sample content spec with a specific ID, and the topics to support it.
Unit tests for any REST client can then be written to retrieve these objects. Since the ids and contents of the objects are known, the expected values of the unit tests are easy to write and check.
The alternative is a more limited testing, the necessity to configure a specific PressGang instance, or encoding installation-specific information in unit tests. All of these are less than ideal.
You can see the unit tests I've written here: https://github.com/jwulf/node-pressgang-rest/blob/master/tests/pressgangccms-wet.spec.js
I have to hard code IDs and Revisions, and I can't test the actual returned strings and objects without: (a) exposing configured data, and (b) making the tests non-portable.