AngularJSUnitTesting : Expected spy function() to have been called
<p>Below is my code , I dont want the service function to be invoked so I am using spy, but its giving error.I am not able to figure it out.</p>

<pre><code>'use strict';

describe('Testing DetailCtrl\n\n\n', function() {

  beforeEach(module("safe-repository"));

  var $controller, $scope, controller;
  var services = {
   documentService:null
  };

  // Initialization before tests
  beforeEach(inject(function(_$controller_, _documentService_){
    $controller = _$controller_;
    $scope = {};
    controller = $controller('DetailCtrl', { $scope: $scope });
    services.documentService=_documentService_;

    spyOn(services.documentService, 'deleteDocument').and.callFake(function(){
           console.log("inside delete function");
    });

  }));


  describe('Testing self.deleteFile() function for different test cases\n\n', function() {


    it(' When user has access permission to delete file/doc', function(done) {
        expect(services.documentService.deleteDocument).toHaveBeenCalled();
        // Inform jasmine that the test finish here
        done();
    });

  });


});
</code></pre>

<p>Any help is appreciated. </p>