I\'m having hard times trying to test promise-based code in Angularjs.
I have the following code in my controller:
$scope.markAsDone = function(t
And as yet another option you can avoid having to call $digest
by using the Q library (https://github.com/kriskowal/q) as a drop-in replacement for $q
e.g:
beforeEach(function () {
module('Module', function ($provide) {
$provide.value('$q', Q);
});
});
This way promises can be resolved/rejected outside of the $digest cycle.