adding test for invalid tags, fixes #40

This commit is contained in:
Alex Kocharin 2014-02-03 00:50:51 +04:00
parent 8840ac4c1f
commit 440f42415c
1 changed files with 8 additions and 0 deletions

View File

@ -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)