Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Commit

Permalink
adding test to check proper handling when no article exists
Browse files Browse the repository at this point in the history
  • Loading branch information
lirantal committed Jan 13, 2015
1 parent 00b5ff0 commit 9952138
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions app/tests/article.server.routes.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 9952138

Please sign in to comment.