From 00648bce16afc67818af015bbb5331946530eed8 Mon Sep 17 00:00:00 2001 From: andsandv Date: Tue, 10 Feb 2015 17:19:32 +0100 Subject: [PATCH] Add test for creating features when name is not unique --- .jshintrc | 2 +- test/featureApiSpec.js | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.jshintrc b/.jshintrc index 6cd19abfe9..5d4e4d2931 100644 --- a/.jshintrc +++ b/.jshintrc @@ -37,7 +37,7 @@ "trailing" : true, "maxparams" : 3, "maxdepth" : 4, - "maxstatements" : 10, + "maxstatements" : 20, "maxcomplexity" : 10, "maxlen" : 120, diff --git a/test/featureApiSpec.js b/test/featureApiSpec.js index c8fb88e0e7..d6c284176e 100644 --- a/test/featureApiSpec.js +++ b/test/featureApiSpec.js @@ -88,4 +88,12 @@ describe('The features api', function () { .expect(404, done); }); + it('refuses to create a feature with an existing name', function (done) { + request + .post('/features') + .send({name: 'featureX'}) + .set('Content-Type', 'application/json') + .expect(403, done); + }); + });