title: The callback has been called, but $broadcast has not?
body: <p>This is my spec file, and I can't get it to work properly.</p>
  
  <p>The service's `execute()` method does some AJAX request. In case of receiving `401 Unauthorized` it should broadcast `evt-unauthorized` on `$rootScope`.</p>
  
  <p>While testing, I've noticed strange thing: `.$broadcast` seems to never have been called. 
  If I add a spy callback though, Jasmine tells that the callback actually has been called, while `.$broadcast` is still untouched. </p>
  
  <p>Am I missing something?</p>
  
  <pre><code>'use strict';
  
  describe('Service: Some_Service', function () {
      var service, http_backend, rootScope;
  
      beforeEach(module('Some_Module'));
  
      beforeEach(inject(function ($httpBackend, $rootScope, Some_Service) {
          http_backend = $httpBackend;
          rootScope = $rootScope.$new();
          service = Some_Service;
          http_backend.whenPOST('http://api.site.com/restricted/area').respond(401);
      }));
  
      it('should broadcast `evt-unauthorized` on root scope in case of 401', function () {
          var done = false;
          var promise;
  
          var callback = jasmine.createSpy('callback');
          spyOn(rootScope, '$broadcast');
          rootScope.$on('evt-unauthorized', callback);
  
          runs(function() {
              promise = service.execute();
              expect(promise).toBeTruthy();
              promise.error(function() {
                  done = true;
                  //this test succeeds
                  expect(callback).toHaveBeenCalled();
                  //this one fails
                  expect(rootScope.$broadcast).toHaveBeenCalled();
              });
              http_backend.flush();
          });
  
          waitsFor(function() {
              return done;
          }, 1000);
      });
  
      afterEach (function () {
          http_backend.verifyNoOutstandingExpectation ();
          http_backend.verifyNoOutstandingRequest ();
      });
  });
  </code></pre>