title: Error: [$injector:unpr] Unknown provider in jasmine test when routeprovider service is injected in a controller
body: <p>I have created an application in angular js, in which i am using ng-view for navigating templates, from routeProvider i am injecting a service called customerDetail to all templates. when i wrote a jasmine testcase for injecting customerDetail services into the CustomerReportController constructor, but i am getting </p>
  
  <pre><code>&lt;failure type=""&gt;Error: [$injector:unpr] Unknown provider: customerDetailProvider &amp;lt;- customerDetail
  </code></pre>
  
  <p>can anyone please tell me some solution for this</p>
  
  <p><strong>main/customerReport/main.spec.js</strong></p>
  
  <pre><code>describe('tsi', function() 
  {
      var $scope, customerDetail;
  
      beforeEach(module('tsi.customerReport'));
  
      beforeEach(inject(function($rootScope, $controller) {
          $scope = $rootScope.$new();
  
          CustomerReportController = $controller('CustomerReportController', {
              $scope: $scope,
              customerDetail: customerDetail
          });
  
      }));
  
      it('test CustomerReportController', inject(function() {
          expect(CustomerReportController).toBeTruthy();
      }));
  });
  </code></pre>
  
  <p><strong>main.js</strong></p>
  
  <pre><code>angular.module( 'tsi', ['tsi.customerDetail', 'ngRoute'])
  
  .config(function(RestangularProvider, $routeProvider)
  {
      RestangularProvider.setBaseUrl('/customer/service/detail');
  
      $routeProvider.when('/customerDetail',
          {
              templateUrl: 'main/main.tpl.html',
              controller: 'CustomerDetailController',
              resolve: {
                  customerDetail: function(CustomerDetailService) {
                     return CustomerDetailService.getServiceDetail();
                  }
              }
          }).when('/customerReport',
          {
              templateUrl: 'main/customerReport/main.tpl.html',
              controller: 'CustomerReportController',
              resolve: {
                  customerDetail: function(CustomerDetailService) {
                     return CustomerDetailService.getServiceDetail();
                  }
              }
          }).otherwise(
          {
              redirectTo: '/customerDetail'
          });
  })
  
  .factory('CustomerDetailService', function(Restangular) {
      return {
          getCustomerDetail: function() {
              return Restangular.one('user/customerDetail').get().then(function(customerDetail) {
                  return customerDetail;
              });
          }
      };
  });
  </code></pre>
  
  <p><strong>main/customerReport/main.js</strong></p>
  
  <pre><code>angular.module('tsi.customerReport', [])
  
  .controller('CustomerReportController', function($scope, $http, $filter, $timeout, customerDetail) 
  {
      $scope.customerOrderDetails = customerDetail;
      :
      :
  });
  </code></pre>