title: Calling $digest on a jasmine test works only the first time
body: <p>I'm trying to test the behavior of a 'watch' on my scope. But the problem is it's called only once. Check the fiddle below. And strangely, i noticed that if you put the variables in the controller's $scope rather than on the controller itself (aka $scope.name vs vm.name) it actually works.</p>
  
  <p><strong><em>Using vm (not working): <a href="http://jsfiddle.net/2Ny8x/60/" rel="nofollow">http://jsfiddle.net/2Ny8x/60/</a></em></strong></p>
  
  <pre><code>//--- CODE --------------------------
  (function (angular) {
      // Create module
      var myApp = angular.module('myApp', []);
  
      // Controller which counts changes to its "name" member
      myApp.controller('MyCtrl', ['$scope', function ($scope) {
          var vm = this;
          vm.name = 'Superhero';
          vm.counter = 0;
          $scope.$watch('vm.name', function (newValue, oldValue) {
              vm.counter = vm.counter + 1;
          });
      }]);      
  })(angular);
  
  
  
  // ---SPECS-------------------------
  
  describe('myApp', function () {
      var scope,
      controller;
      beforeEach(function () {
          module('myApp');
      });
  
      describe('MyCtrl', function () {
          beforeEach(inject(function ($rootScope, $controller) {
              scope = $rootScope.$new();
              controller = $controller('MyCtrl', {
                  '$scope': scope
              });
          }));
          it('sets the name', function () {
              expect(controller.name).toBe('Superhero');
          });
  
          it('watches the name and updates the counter', function () {
              expect(controller.counter).toBe(0);
              controller.name = 'Batman';
              scope.$digest();
              expect(controller.counter).toBe(1);
              controller.name = 'Superman';            
              scope.$digest();
              expect(controller.counter).toBe(2);
          });
      });
  
  
  
  });
  </code></pre>
  
  <p><strong><em>Using $scope (works): <a href="http://jsfiddle.net/2Ny8x/61/" rel="nofollow">http://jsfiddle.net/2Ny8x/61/</a></em></strong></p>
  
  <pre><code>//--- CODE --------------------------
  (function (angular) {
      // Create module
      var myApp = angular.module('myApp', []);
  
      // Controller which counts changes to its "name" member
      myApp.controller('MyCtrl', ['$scope', function ($scope) {       
          $scope.name = 'Superhero';
          $scope.counter = 0;
          $scope.$watch('name', function (newValue, oldValue) {
              $scope.counter = $scope.counter + 1;
          });
      }]);      
  })(angular);
  
  
  
  // ---SPECS-------------------------
  
  describe('myApp', function () {
      var scope,
      controller;
      beforeEach(function () {
          module('myApp');
      });
  
      describe('MyCtrl', function () {
          beforeEach(inject(function ($rootScope, $controller) {
              scope = $rootScope.$new();
              controller = $controller('MyCtrl', {
                  '$scope': scope
              });
          }));
          it('sets the name', function () {
              expect(scope.name).toBe('Superhero');
          });
  
          it('watches the name and updates the counter', function () {
              expect(scope.counter).toBe(0);
              scope.name = 'Batman';
              scope.$digest();
              expect(scope.counter).toBe(1);
              scope.name = 'Superman';            
              scope.$digest();
              expect(scope.counter).toBe(2);
          });
      });
  
  
  
  });
  </code></pre>