Test:
it('call:start', function () {
rootScope.$broadcast('call:start');
expect(controller.conditionalPause.called).to.equal(true);
});
Passes:
$rootScope.$on('call:start', function () {
self.conditionalPause();
});
Fails:
$rootScope.$on('call:start', self.conditionalPause);
Why?
In the failing test, it hits $on 'call:start
and calls the callback. It even logs something out when I add a console.log
to self.conditionalPause
. So why isn't the test passing?