From cf541cb8281a5c391d3e3d72c905dbf37ef4314d Mon Sep 17 00:00:00 2001 From: Miroslav Bajtos Date: Thu, 21 Nov 2013 16:17:19 +0100 Subject: [PATCH] Add test for findById returning 404 The test verifies the remoting configuration of loopback-datasource-juggler, ensuring that `DataAccessObject.findById()` has `rest.before` handler correctly set up. --- test/model.test.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/model.test.js b/test/model.test.js index d0686fee..33d81ed9 100644 --- a/test/model.test.js +++ b/test/model.test.js @@ -296,6 +296,13 @@ describe('Model', function() { done(); }); }); + + it('Converts null result of findById to 404 Not Found', function(done) { + request(app) + .get('/users/not-found') + .expect(404) + .end(done); + }); }); describe('Model.beforeRemote(name, fn)', function(){