My factory, called myFactory, has a dependency on $http. When writing tests for this, I needed to mock this dependency. After some research, I discovered that I could accomplish this using $httpBackend. Implementing the code below successfully achieved the mocking, but I am unsure of when Angular recognizes that httpBackend is replacing $http within myFactory.
beforeEach(inject(function(_myFactory_, _$httpBackend_){
myFactory = _myFactory_;
$httpBackend = _$httpBackend_;
}));