From 05aa683dbf033a56dcc7061b5af477537ddc9085 Mon Sep 17 00:00:00 2001 From: Chakrit Wichian Date: Fri, 1 Mar 2013 18:47:45 +0700 Subject: [PATCH] Add test for .members --- test/groups-test.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/test/groups-test.js b/test/groups-test.js index 1684d00..5b29573 100755 --- a/test/groups-test.js +++ b/test/groups-test.js @@ -13,7 +13,7 @@ var Tom = group('tom') test('test all the things', function (t) { - t.plan(98) + t.plan(100) Tom.membership.add('anonymous', function (error, result) { t.deepEqual(error, null, 'error should be null') @@ -163,6 +163,10 @@ test('test all the things', function (t) { t.deepEqual(result.sort(), [ 'javascript', 'nodejs', 'otherGroup', 'anonymous', 'admin', 'one', 'two' ].sort(), 'result should be the same') }) + nodejs.members.has(javascript, function (error, result) { + t.notOk(result, 'result should be falsy') + }) + nodejs.members.add(javascript, function (error, result) { t.deepEqual(error, null, 'error should be null') t.deepEqual(result, [ 1, 1 ], 'result should be the same') @@ -172,6 +176,10 @@ test('test all the things', function (t) { }) }) + nodejs.members.has(javascript, function (error, result) { + t.ok(result, 'result should be truthy') + }) + javascript.members.all(function (error, result) { t.deepEqual(error, null, 'error should be null') t.deepEqual(result.sort(), [ 'tom', 'bob', 'bill' ].sort(), 'result should be the same')