From 995213881d683f0b940c000b3c7545019c020f07 Mon Sep 17 00:00:00 2001 From: Liran Tal Date: Tue, 13 Jan 2015 16:55:01 +0200 Subject: [PATCH] adding test to check proper handling when no article exists --- app/tests/article.server.routes.test.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/tests/article.server.routes.test.js b/app/tests/article.server.routes.test.js index 2576095ae1..34255f5e18 100644 --- a/app/tests/article.server.routes.test.js +++ b/app/tests/article.server.routes.test.js @@ -201,6 +201,17 @@ describe('Article CRUD tests', function() { }); }); + it('should return proper error for single article which doesnt exist, if not signed in', function(done) { + request(app).get('/articles/test') + .end(function(req, res) { + // Set assertion + res.body.should.be.an.Object.with.property('message', 'Article is invalid'); + + // Call the assertion callback + done(); + }); + }); + it('should be able to delete an article if signed in', function(done) { agent.post('/auth/signin') .send(credentials)