$httpBackend is undefined although angular-mock is included
This is my test. I get error that $httpBackend is undefined. describe("Objects Service", function () { var $httpBackend, $rootScope, scope, datacontext, config; beforeEach(function () { module('agApp'); }); beforeEach(inject(function ($rootScope, _$httpBackend_, _datacontext_, _config_) { scope = $rootScope.$new(); datacontext = _datacontext_; $httpBackend = _$httpBackend_; config = _config_; })); it("should call right API adress to get all objects", function () { $httpBackend.whenGET('/api/objects').respond(200); datacontext.objects.getObjects(function (data) { $httpBackend.flush(); }); });