Last active
August 29, 2015 14:06
-
-
Save rudigiesler/6b9f10e8247f49554d1e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| + 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(); | |
| + }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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(); | |
| }); |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Similar action works here: https://github.com/praekelt/vumi-jssandbox-toolkit/blob/master/test/test_states/test_choices.js#L322