Skip to content

Node.js based forum software built for the modern web

added a new test for group renaming, #2629

Julian Lam81c929fa7739
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();