From 63b3c56cc5c654bdd581f407abf5d6dc475dadac Mon Sep 17 00:00:00 2001 From: Jari Bakken Date: Tue, 25 Nov 2014 16:34:24 +0100 Subject: [PATCH] Add test for /strategies/:name 403 if strategy exists. --- test/strategyApiSpec.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/strategyApiSpec.js b/test/strategyApiSpec.js index d11c1e0200..5da09317ac 100644 --- a/test/strategyApiSpec.js +++ b/test/strategyApiSpec.js @@ -36,5 +36,13 @@ describe('The strategy api', function () { .expect(400, done); }); + it('refuses to create a strategy with an existing name', function (done) { + request + .post('/strategies') + .send({name: 'default'}) + .set('Content-Type', 'application/json') + .expect(403, done); + }); + }); \ No newline at end of file