Comprehensive test suite for json_server
List of tests we should do in JSON Server
Blueprint information
- Status:
- Complete
- Approver:
- Henrik Ingo
- Priority:
- Undefined
- Drafter:
- Henrik Ingo
- Direction:
- Approved
- Assignee:
- Mohit Srivastava
- Definition:
- New
- Series goal:
- None
- Implementation:
-
Implemented
- Milestone target:
-
7.2.3
- Started by
- Henrik Ingo
- Completed by
- Henrik Ingo
Related branches
Related bugs
Sprints
Whiteboard
Currently you have:
*******
exec curl -H "Content-Type: application/json" -H "Accept: application/json" -X POST -d '{"_id"
--exec curl -H "Content-Type: application/json" -H "Accept: application/json" -X POST -d '{"_id"
--exec curl 'http://
*******
I propose changes: Between the first and second POST, do a GET to retrieve the inserted document. Now change the second POST so the document is different (like "age" : 36)
Ideas for more tests:
Leave out _id (so that auto_increment is used). GET it.
Post something that is not valid json.
Post something where the top level key is not "document" (this will fail and it is ok).
POST { "_id" : <number>, "document" : "some string"}
POST { "_id" : <number>, "document" : <number>}
POST { "_id" : <number>, "document" : {... some json...}, "metadata" : { ...more json... } } ' http://
GET anothertable
# This will get the full record now, but a future feature is that the document key should not be returned with this query document.
GET { "_id" : <number>, "metadata" : null }
INSERT INTO anothertable VALUES ( <number>, "This text is not valid JSON", "Neither is this")
# Will fail but must not crash server.
GET <number from above> from anothertable
Work Items
Dependency tree

* Blueprints in grey have been implemented.