Ejemplo n.º 1
0
		it("should cache the response in the $http cache", (): void => {
			const httpGet: SinonStub = sinon.stub($http, "get").returns({
				then(): void {
					// Do nothing
				}
			});

			payeeModel.all();
			httpGet.firstCall.args[1].should.have.a.property("cache").that.is.not.false;
		});
Ejemplo n.º 2
0
		it("should return a list of all payees", (): void => {
			$httpBackend.when("GET", expectedUrl).respond(200, expectedResponse);
			payeeModel.all().should.eventually.equal(expectedResponse);
			$httpBackend.flush();
		});
Ejemplo n.º 3
0
		it("should dispatch a GET request to /payees", (): void => {
			$httpBackend.expect("GET", expectedUrl).respond(200);
			payeeModel.all();
			$httpBackend.flush();
		});