Skip to content

Commit

Permalink
Test releasing tokens by beneficiaries and others
Browse files Browse the repository at this point in the history
  • Loading branch information
mariuszzak authored and MichalZalecki committed Jul 18, 2018
1 parent fbe6c5c commit 6a726ed
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion test/03-token-vesting/MultiBeneficiaryTokenVestingTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const beneficiary2 = '0x9e9Bf5E5D100f45a3527c7eacC84E0a185fc7E0D';
const beneficiary3 = '0xc63f73cdf9dd2d0aafc63d650d637a848f469a89';

contract("MultiBeneficiaryTokenVesting", (accounts) => {
const [owner] = accounts;
const [owner, other] = accounts;

let token;
let tokenVesting;
Expand Down Expand Up @@ -64,6 +64,20 @@ contract("MultiBeneficiaryTokenVesting", (accounts) => {
});
});

describe("releasing tokens", () => {
it("allows a beneficiary to release tokens", async () => {
expect(tokenVesting.releaseAllTokens).not.to.throw();
});

it("disallows others to release tokens", async () => {
tokenVesting.releaseAllTokens({from: other}).then(assert.fail).catch((error) => {
if(error.toString().indexOf("transaction: revert") === -1) {
assert(false, error.toString());
}
});
});
});

describe("releasing tokens in time", () => {
beforeEach(async () => {
await tokenVesting.addBeneficiary(beneficiary1, 1);
Expand Down

0 comments on commit 6a726ed

Please sign in to comment.