Skip to content

Instantly share code, notes, and snippets.

@rudigiesler
Last active August 29, 2015 14:06
Show Gist options
  • Save rudigiesler/6b9f10e8247f49554d1e to your computer and use it in GitHub Desktop.
Save rudigiesler/6b9f10e8247f49554d1e to your computer and use it in GitHub Desktop.
+ it('should fire the metrics for each new user', function() {
+ return tester
+ .inputs(
+ {from_addr: '+271234', content: null},
+ {from_addr: '+274321', content: null})
+ .check(function(api, im , app) {
+ metrics = api.metrics
+ .stores['metricsHelper-tester'].uniqueUsers;
+ assert.deepEqual(
+ metrics, {agg: 'sum', values: [1]});
+ })
+ .run();
+ });
return Q()
.then(function() {
return tester
.setup.user.addr('+271234')
.start()
.check(function(api, im , app) {
metrics1 = api.metrics
.stores['metricsHelper-tester'].uniqueUsers;
assert.deepEqual(metrics1, {agg: 'sum', values: [1]});
})
.run();
})
.then(function() {
return tester
.setup.user.addr('+274321')
.start()
.check(function(api, im , app) {
metrics1 = api.metrics
.stores['metricsHelper-tester'].uniqueUsers;
assert.deepEqual(metrics1, {agg: 'sum', values: [1,1]});
})
.run();
});
@rudigiesler
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment