Skip to content
Browse files

Generic errors work pretty good.

  • Loading branch information...
1 parent 92a3a46 commit afa8b641f12a6c0736b7ae169cd0570bbd876095 @brianloveswords brianloveswords committed Sep 19, 2012
Showing with 10 additions and 3 deletions.
  1. +10 −3 test/bakery.test.js
View
13 test/bakery.test.js
@@ -132,7 +132,14 @@ test('bakery.debake: 404 should return error', function (t) {
});
});
-test('bakery.debake:', function (t) {
-
- t.end();
+test('bakery.debake: 500 should return generic error', function (t) {
+ var opts = { body: 'x', statusCode: 500 };
+ broil(opts, function (baked) {
+ bakery.debake(baked, function (err, contents) {
+ t.ok(err, 'should have an error');
+ t.same(err.code, 'RESOURCE_ERROR', 'should have a generic resource error');
+ t.same(err.httpStatusCode, 500, 'should have a 500');
+ t.end();
+ });
+ });
});

0 comments on commit afa8b64

Please sign in to comment.
Something went wrong with that request. Please try again.