Esempio n. 1
0
		it("should dispatch a POST request to /accounts when an id is not provided", (): void => {
			delete account.id;
			$httpBackend.expectPOST(/accounts$/);
			accountModel.save(account);
			$httpBackend.flush();
		});
Esempio n. 2
0
		it("should dispatch a PATCH request to /accounts/{id} when an id is provided", (): void => {
			$httpBackend.expectPATCH(/accounts\/1$/);
			accountModel.save(account);
			$httpBackend.flush();
		});
Esempio n. 3
0
		it("should flush the account cache", (): void => {
			accountModel.save(account);
			accountModel.flush.should.have.been.called;
			$httpBackend.flush();
		});