TypeError: 'undefined' is not a function (evaluating 'mockBackend.expectPost(
问题 I am trying to unit test an angularjs controller with Karma, and jasmine. Here is my test suite: describe('Controllers', function(){ var $scope, ctrl; beforeEach(module('curriculumModule')); describe('CreateCurriculumCtrl', function(){ var mockBackend, location; beforeEach(inject(function($rootScope, $controller, _$httpBackend_, $location){ mockBackend = _$httpBackend_; location = $location; $scope = $rootScope.$new(); ctrl = $controller('CreateCurriculumCtrl', { $scope: $scope }); })); it(