title: Jasmine/AngularJS: Inject dependent service to service in unit test?
body: <p>I have angular modules:</p>
  
  <pre><code>var app = angular.module("SearchUI",[]);
  </code></pre>
  
  <p>in it, I have a service "configService", that maintains bunch of config params:</p>
  
  <pre><code>app.provider("configService",function(){
    //stuff here
  })
  </code></pre>
  
  <p>I have ran the jasmine unit tests in configService fineL</p>
  
  <pre><code>describe('configService',function(){
  
  var configService,$httpBackend;
  
  
      beforeEach(module('SearchUI'));
      beforeEach(inject(function(_configService_,$injector){
          configService = _configService_;    
          $httpBackend = $injector.get("$httpBackend");
  
      }));
  
      it('should have default values for configService', function(){
          expect(configService.getDefaultSearch()).toEqual(['abstract','title','keyword','keywordplus'
      ]);
      });
  
  //other stuff
  </code></pre>
  
  <p>all tests pass fine.</p>
  
  <p>however, I am not understanding how to maintain that injection in another service:</p>
  
  <p>i.e in my application:</p>
  
  <pre><code>app.service("SearchService",function($http,$log,configService,$q){
      //stuff
      search_params = configService.getDefaultSearch();
  
  })
  </code></pre>
  
  <p>my spec:</p>
  
  <pre><code>describe('SearchService',function(){
      var searchService,configService;
  
      beforeEach(module('SearchUI'));
      beforeEach(inject(function(_configService_,_SearchService_){
          configService = _configService_;    
          searchService = _SearchService_;
  
      }));
  
  
      it('SearchService should return results', function(){
          var waiting = searchService.SimpleSearch("card","wos",0);
  
  
  //other stuff
  </code></pre>
  
  <p>the spec fails because in simplesearch function requires this:</p>
  
  <pre><code>search_params = configService.getDefaultSearch(); //get the default search parameters       
  </code></pre>
  
  <p>my question is, how do I inject the required service in to the ANOTHER service?</p>