|
// @TODO: Consider changing this to return a proper error status code |
});
});
it('should handle a non-existing template request', function(done) {
Blast.fetch(url + '?view=does_not_exist_at_all', function gotResponse(err, res, body) {
// Currently, a non-existing template returns a 200 status code with a fallback view.
// This is arguably incorrect behavior - ideally it should return 404 or 500.
// However, for now we document and test the current behavior.
// @TODO: Consider changing this to return a proper error status code
// The request should complete without error
assert.strictEqual(!!err, false, 'Request should complete without error');
// Currently returns 200 (documenting existing behavior)
assert.strictEqual(res.statusCode, 200,
'Currently returns 200 for missing template (known limitation)');
done();
});
});
alchemy/test/25-controller.js
Line 197 in fb675f7