title: AngularJS Controller empty after Jasmine injection
body: <p>I want to test an AngularJS controller with Jasmine. My problem is:
  After creating the controller, the object is empty.</p>
  
  <p>Here is the AngularJS controller:</p>
  
  <pre><code>    angular
        .module('controlcenter.reports')
        .controller('ReportsController', ReportsController);
  
      ReportsController.$inject = ['$scope', '$state', 'Api'];
  
      function ReportsController($scope, $state, Api) {
  
        var getReportWebsites = function() {
          Api.getReportsWebsites().then(function(reports) {
            $scope.reports = reports.data;
          }, function(error) {
            console.log('error', error);
          });
        };
  
         $scope.showDetails = function(id) {
          $state.go('reportDetails.overview', {id: id});
        };
  
        getReportWebsites();
      }
  </code></pre>
  
  <p>And here is my test:</p>
  
  <pre><code>describe('ReportsController', function() {
  
    var scope;
    var ctrl;
  
    beforeEach(module('controlcenter.reports'));
    beforeEach(module('authentication'));
    beforeEach(module('api'));
  
    beforeEach(inject(function($rootScope, $controller) {
      scope = $rootScope.$new();
      ctrl = $controller('ReportsController', {$scope: scope});
    }));
  
    it('dummy test', function(){
      spyOn('ctrl', getReportWebsites);
    });
  });
  </code></pre>
  
  <p><a href="https://stackoverflow.com/questions/22632748/angularjs-injected-controller-empty-when-testing-with-jasmine">I've read this SO question</a>, so I put the functions inside the scope. But even this is empty. </p>
  
  <p>I've read tons of Controller testing tutorials, but even after just copy&amp;pasting the code, my controller is always empty. </p>
  
  <blockquote>
    <p>So, how to properly test an AngularJS controller?</p>
  </blockquote>
  
  <p>I also don't want to put everything inside the scope, though.</p>