describe('fooService', function () { var service, httpBackend, Order; beforeEach(function() { module('myApp'); inject(function(fooService, $httpBackend, _Order_) { service = fooService; httpBackend = $httpBackend; Order = _Order_; }); }); it ('initially has default order', function () { expect(service.order instanceof Order).toBe(true); }); it ('updates order with http data', function () { var expected = {total:23,description:"test"}; httpBackend.expectGET('someurl').respond(expected); httpBackend.flush(); expect(service.order).toEqual(new Object(expected)); }); });