From b4c98a89bd25b0494cc6aa1f32ee4d591b462095 Mon Sep 17 00:00:00 2001 From: Kayvon Tehranian Date: Mon, 26 Feb 2018 12:27:42 -0800 Subject: [PATCH] add test to ensure subsequent calls to `collateralize` throw --- test/ts/unit/collateralized_contract.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/ts/unit/collateralized_contract.ts b/test/ts/unit/collateralized_contract.ts index 75986ced..702d462d 100644 --- a/test/ts/unit/collateralized_contract.ts +++ b/test/ts/unit/collateralized_contract.ts @@ -181,6 +181,16 @@ contract("CollateralizedContract (Unit Tests)", async (ACCOUNTS) => { expect(logReturned).to.deep.equal(logExpected); }); + it("should throw on subsequent calls to `collateralize`", async () => { + await expect(collateralContract.collateralize.sendTransactionAsync( + AGREEMENT_ID, + mockToken.address, + new BigNumber(1), + new BigNumber(moment().add(2, 'years').unix()), + { from: COLLATERALIZER } + )).to.eventually.be.rejectedWith(REVERT_ERROR); + }); + }); });