describe('fooService', function () {
var service, httpBackend;
beforeEach(function() {
module('myApp');
inject(function(fooService, $httpBackend) {
service = fooService;
httpBackend = $httpBackend;
});
});
it ('getAsync returns resolved http order data', function () {
var expected = {};
httpBackend.expectGET('someurl').respond(expected);
var onSuccess = jasmine.createSpy(); // sinon.spy();
service.getAsync().then(onSuccess);
httpBackend.flush();
expect(onSuccess).toHaveBeenCalledWith(expected);
});
});