From 440f42415ce98369e5a519ae36ed317d547062d6 Mon Sep 17 00:00:00 2001 From: Alex Kocharin Date: Mon, 3 Feb 2014 00:50:51 +0400 Subject: [PATCH] adding test for invalid tags, fixes #40 --- test/functional/addtag.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/functional/addtag.js b/test/functional/addtag.js index bf5522d22..593f5658b 100644 --- a/test/functional/addtag.js +++ b/test/functional/addtag.js @@ -39,6 +39,14 @@ module.exports = function() { }) }) + it('add tag - bad tag', function(cb) { + server.add_tag('testpkg-tag', 'tag/tag/tag', '0.0.1-x', function(res, body) { + assert.equal(res.statusCode, 403) + assert(~body.error.indexOf('invalid tag')) + cb() + }) + }) + it('add tag - good', function(cb) { server.add_tag('testpkg-tag', 'tagtagtag', '0.0.1', function(res, body) { assert.equal(res.statusCode, 201)