Increase testing coverage (#1195)

* Added non-target bounty test

* Increased ERC721 testing coverage.

* Addressed review comments.

* fix linter error

* Fixed linter error

* Removed unnecessary bouncer require

* Improved Crowdsale tests.

* Added missing SuperUser test.

* Improved payment tests.

* Improved token tests.

* Fixed ERC721 test.

* Reviewed phrasing.
This commit is contained in:
Nicolás Venturo
2018-08-14 19:37:30 -03:00
committed by GitHub
parent d51e38758e
commit 8d11dcc0e5
11 changed files with 404 additions and 241 deletions

View File

@ -1,3 +1,4 @@
const { assertRevert } = require('../../helpers/assertRevert');
const { ether } = require('../../helpers/ether');
const { shouldBehaveLikeMintableToken } = require('./MintableToken.behavior');
const { shouldBehaveLikeCappedToken } = require('./CappedToken.behavior');
@ -7,10 +8,18 @@ const CappedToken = artifacts.require('CappedToken');
contract('Capped', function ([_, owner, ...otherAccounts]) {
const cap = ether(1000);
beforeEach(async function () {
this.token = await CappedToken.new(cap, { from: owner });
it('requires a non-zero cap', async function () {
await assertRevert(
CappedToken.new(0, { from: owner })
);
});
shouldBehaveLikeCappedToken(owner, otherAccounts, cap);
shouldBehaveLikeMintableToken(owner, owner, otherAccounts);
context('once deployed', async function () {
beforeEach(async function () {
this.token = await CappedToken.new(cap, { from: owner });
});
shouldBehaveLikeCappedToken(owner, otherAccounts, cap);
shouldBehaveLikeMintableToken(owner, owner, otherAccounts);
});
});