Skip to content

Commit

Permalink
Add more tests + update links to submodules
Browse files Browse the repository at this point in the history
  • Loading branch information
wilkinson committed Jan 13, 2015
1 parent 630319d commit f466202
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/npm-module
Submodule npm-module updated 1 files
+10 −8 lib/defs-mongo.js
2 changes: 1 addition & 1 deletion src/ruby-gem
Submodule ruby-gem updated 2 files
+16 −15 lib/defs-mongo.rb
+9 −11 lib/service.rb
46 changes: 46 additions & 0 deletions tests/api-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,18 @@
}
}]);

test([{
'label': 'GET requests must specify a non-empty "box"',
'req': {
'method': 'GET',
'path': '/box/?key=hello'
},
'res': {
'data': '',
'statusCode': 444
}
}]);

test([{
'label': 'GET requests must specify a "key" or a "status"',
'req': {
Expand Down Expand Up @@ -314,6 +326,40 @@
}
}]);

test([{
'label': 'In `set_avar` route, "box" cannot be zero-length for avar',
'req': {
'data': '{"box":"","key":"regular_avar","val":2}',
'headers': {
'Content-Length': 39,
'Content-Type': 'application/json'
},
'method': 'POST',
'path': '/box/?key=regular_avar'
},
'res': {
'data': '',
'statusCode': 444
}
}]);

test([{
'label': '`set_avar` route must specify a non-empty "box" for task',
'req': {
'data': '{"box":"","key":"task_avar","status":"waiting","val":2}',
'headers': {
'Content-Length': 55,
'Content-Type': 'application/json'
},
'method': 'POST',
'path': '/box/?key=task_avar'
},
'res': {
'data': '',
'statusCode': 444
}
}]);

test([{
// NOTE: This test may not actually be important ...
'label': 'In `get_avar` route, "box" cannot contain a `.` character',
Expand Down

0 comments on commit f466202

Please sign in to comment.