Skip to content

Commit

Permalink
test: update to use opts.{mod,admin}Keys
Browse files Browse the repository at this point in the history
  • Loading branch information
hackergrrl committed May 22, 2020
1 parent fe7443a commit 5f122b7
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions test/mod.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ test('block a user by key', function (t) {
cabal0.ready(function () {
cabal0.getLocalKey(function (err, key) {
t.error(err)
var cabal1 = Cabal(ram, addr + "?admin=" + key)
var cabal2 = Cabal(ram, addr + "?admin=" + key)
var cabal1 = Cabal(ram, addr, { adminKeys: [key] })
var cabal2 = Cabal(ram, addr, { adminKeys: [key] })
var pending = 3
cabal1.ready(function () {
if (--pending === 0) ready(cabal0, cabal1, cabal2)
Expand Down Expand Up @@ -95,8 +95,8 @@ test('delegated moderator ban a user by key', function (t) {
cabal0.ready(function () {
cabal0.getLocalKey(function (err, key) {
t.error(err)
var cabal1 = Cabal(ram, addr + "?admin=" + key)
var cabal2 = Cabal(ram, addr + "?admin=" + key)
var cabal1 = Cabal(ram, addr, { adminKeys: [key] })
var cabal2 = Cabal(ram, addr, { adminKeys: [key] })
var pending = 3
cabal1.ready(function () {
if (--pending === 0) ready(cabal0, cabal1, cabal2)
Expand Down Expand Up @@ -156,9 +156,9 @@ test('different mod keys have different views', function (t) {
cabal0.ready(function () {
cabal0.getLocalKey(function (err, key) {
t.error(err)
var cabal1 = Cabal(ram, addr + "?admin=" + key)
var cabal1 = Cabal(ram, addr, { adminKeys: [key] })
var cabal2 = Cabal(ram, addr)
var cabal3 = Cabal(ram, addr + "?admin=" + key)
var cabal3 = Cabal(ram, addr, { adminKeys: [key] })
var pending = 4
cabal1.ready(function () {
if (--pending === 0) ready(cabal0, cabal1, cabal2, cabal3)
Expand Down Expand Up @@ -248,9 +248,9 @@ test('blocks across channels', function (t) {
cabal0.ready(function () {
cabal0.getLocalKey(function (err, key) {
t.error(err)
var cabal1 = Cabal(ram, addr+'?admin='+key)
var cabal2 = Cabal(ram, addr+'?admin='+key)
var cabal3 = Cabal(ram, addr+'?admin='+key)
var cabal1 = Cabal(ram, addr, { adminKeys: [key] })
var cabal2 = Cabal(ram, addr, { adminKeys: [key] })
var cabal3 = Cabal(ram, addr, { adminKeys: [key] })
var pending = 4
cabal1.ready(function () {
if (--pending === 0) ready(cabal0, cabal1, cabal2, cabal3)
Expand Down Expand Up @@ -342,8 +342,8 @@ test('block and then unblock', function (t) {
cabals[0].ready(function () {
cabals[0].getLocalKey(function (err, key) {
t.error(err)
cabals.push(Cabal(ram, addr + "?admin=" + key))
cabals.push(Cabal(ram, addr + "?admin=" + key))
cabals.push(Cabal(ram, addr, { adminKeys: [key] }))
cabals.push(Cabal(ram, addr, { adminKeys: [key] }))
getKeys(cabals, function (err, keys) {
ready(cabals, keys)
})
Expand Down

0 comments on commit 5f122b7

Please sign in to comment.