it("should cache the response in the $http cache", (): void => { const httpGet: SinonStub = sinon.stub($http, "get").returns({ then(): void { // Do nothing } }); securityModel.all(); httpGet.firstCall.args[1].should.have.a.property("cache").that.is.not.false; });
it("should return a list of all securities without their balances", (): void => { $httpBackend.when("GET", expectedUrl).respond(200, expectedResponse); securityModel.all().should.eventually.equal(expectedResponse); $httpBackend.flush(); });
it("should dispatch a GET request to /securities", (): void => { $httpBackend.expect("GET", expectedUrl).respond(200); securityModel.all(); $httpBackend.flush(); });