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

@ -17,7 +17,7 @@ const sendReward = async (from, to, value) => ethSendTransaction({
const reward = new web3.BigNumber(web3.toWei(1, 'ether'));
contract('Bounty', function ([_, owner, researcher]) {
contract('Bounty', function ([_, owner, researcher, nonTarget]) {
context('against secure contract', function () {
beforeEach(async function () {
this.bounty = await SecureTargetBounty.new({ from: owner });
@ -82,6 +82,12 @@ contract('Bounty', function ([_, owner, researcher]) {
researcherCurrBalance.sub(researcherPrevBalance).should.be.bignumber.equal(reward.sub(gasCost));
});
it('cannot claim reward from non-target', async function () {
await assertRevert(
this.bounty.claim(nonTarget, { from: researcher })
);
});
context('reward claimed', function () {
beforeEach(async function () {
await this.bounty.claim(this.targetAddress, { from: researcher });