コード例 #1
0
ファイル: category.ts プロジェクト: scottohara/loot
		it("should cache the response in the $http cache", (): void => {
			const httpGet: SinonStub = sinon.stub($http, "get").returns({
				then(): void {
					// Do nothing
				}
			});

			categoryModel.all();
			httpGet.firstCall.args[1].should.have.a.property("cache").that.is.not.false;
		});
コード例 #2
0
ファイル: category.ts プロジェクト: scottohara/loot
		it("should return a list of all categories without their children", (): void => {
			$httpBackend.when("GET", expectedUrl).respond(200, expectedResponse);
			categoryModel.all(1).should.eventually.equal(expectedResponse);
			$httpBackend.flush();
		});
コード例 #3
0
ファイル: category.ts プロジェクト: scottohara/loot
		it("should dispatch a GET request to /categories?parent={parent}", (): void => {
			$httpBackend.expect("GET", expectedUrl).respond(200);
			categoryModel.all(1);
			$httpBackend.flush();
		});