Use constants for tests
This commit is contained in:
parent
f7d1f9426c
commit
aa68dff24b
@ -1,3 +1,4 @@
|
||||
var Channel = require('../../../batch/pubsub/channel');
|
||||
var JobPublisher = require('../../../batch/pubsub/job-publisher');
|
||||
var assert = require('assert');
|
||||
|
||||
@ -10,7 +11,7 @@ describe('batch API job publisher', function () {
|
||||
return this;
|
||||
},
|
||||
publish: function () {
|
||||
var isValidFirstArg = arguments[0] === 'batch:hosts';
|
||||
var isValidFirstArg = arguments[0] === Channel.NAME;
|
||||
var isValidSecondArg = arguments[1] === self.host;
|
||||
self.redis.publishIsCalledWithValidArgs = isValidFirstArg && isValidSecondArg;
|
||||
},
|
||||
|
@ -1,3 +1,4 @@
|
||||
var Channel = require('../../../batch/pubsub/channel');
|
||||
var JobSubscriber = require('../../../batch/pubsub/job-subscriber');
|
||||
var assert = require('assert');
|
||||
|
||||
@ -11,7 +12,7 @@ describe('batch API job subscriber', function () {
|
||||
return this;
|
||||
},
|
||||
subscribe: function () {
|
||||
var isValidFirstArg = arguments[0] === 'batch:hosts';
|
||||
var isValidFirstArg = arguments[0] === Channel.NAME;
|
||||
self.redis.subscribeIsCalledWithValidArgs = isValidFirstArg;
|
||||
},
|
||||
on: function () {
|
||||
@ -20,7 +21,7 @@ describe('batch API job subscriber', function () {
|
||||
}
|
||||
},
|
||||
unsubscribe: function () {
|
||||
var isValidFirstArg = arguments[0] === 'batch:hosts';
|
||||
var isValidFirstArg = arguments[0] === Channel.NAME;
|
||||
self.redis.unsubscribeIsCalledWithValidArgs = isValidFirstArg;
|
||||
},
|
||||
scan: function(params, callback) {
|
||||
|
Loading…
Reference in New Issue
Block a user