From ae444039b10f61e7e83d2bf627d8ac01109ad1b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivar=20Conradi=20=C3=98sthus?= Date: Thu, 5 Feb 2015 16:46:07 +0100 Subject: [PATCH] #33 Added unit test for createdBy --- test/featureApiSpec.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/test/featureApiSpec.js b/test/featureApiSpec.js index d93acee57c..c8fb88e0e7 100644 --- a/test/featureApiSpec.js +++ b/test/featureApiSpec.js @@ -36,6 +36,22 @@ describe('The features api', function () { .expect(201, done); }); + it('creates new feature toggle with createdBy', function (done) { + request + .post('/features') + .send({name: 'com.test.Username', enabled: false}) + .set('Cookie', ['username=ivaosthu']) + .set('Content-Type', 'application/json') + .end(function(){ + request + .get('/events') + .end(function (err, res) { + assert.equal(res.body.events[0].createdBy, 'ivaosthu'); + done(); + }); + }); + }); + it('require new feature toggle to have a name', function (done) { request .post('/features') @@ -72,4 +88,4 @@ describe('The features api', function () { .expect(404, done); }); -}); \ No newline at end of file +});