From 81c929fa77395a20eb16e47a56d567676bfd8d16 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Mon, 19 Jan 2015 15:14:34 -0500 Subject: [PATCH] added a new test for group renaming, #2629 --- tests/groups.js | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/tests/groups.js b/tests/groups.js index 22300193dc..47da1b8bbb 100644 --- a/tests/groups.js +++ b/tests/groups.js @@ -212,18 +212,35 @@ describe('Groups', function() { }); }); }); + + it('should rename a group if the name was updated', function(done) { + Groups.update('foo', { + name: 'foobar?' + }, function(err) { + if (err) return done(err); + + Groups.get('foobar?', {}, function(err, groupObj) { + if (err) return done(err); + + assert.strictEqual('foobar?', groupObj.name); + assert.strictEqual('foobar', groupObj.slug); + + done(); + }); + }); + }); }); describe('.destroy()', function() { before(function(done) { - Groups.join('foo', 1, done); + Groups.join('foobar?', 1, done); }); it('should destroy a group', function(done) { - Groups.destroy('foo', function(err) { + Groups.destroy('foobar?', function(err) { if (err) return done(err); - Groups.get('foo', {}, function(err) { + Groups.get('foobar?', {}, function(err) { assert(err, 'Group still exists!'); done();