title: Returning promise but still .then is undefined in angular jasmine unit test
body: <p>I want to replace actual service with mock service while writing Unit test cases for controller. What I'm trying to achieve is using <code>.and.callFake</code> function of jasmine but its not working as expected.</p>
  
  <p>See <a href="http://jsfiddle.net/619frt3L/4/" rel="nofollow">jsfiddle</a></p>
  
  <pre><code>spyOn(mockTestService,'getData').and.callFake(function() {
       console.log("log from mock service");
       deferred.resolve({data : "mockRes"});
       return deferred.promise;
  });
  </code></pre>
  
  <p>I want to return mock data for one of my service call and verify success call back function of controller.</p>