Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Improved MintedCrowdsale tests.
  • Loading branch information
nventuro committed Aug 24, 2018
commit ba02ab042286be2cc5460447f1e87765e083d3d6
17 changes: 17 additions & 0 deletions test/crowdsale/MintedCrowdsale.test.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
const { shouldBehaveLikeMintedCrowdsale } = require('./MintedCrowdsale.behavior');
const { ether } = require('../helpers/ether');
const { assertRevert } = require('../helpers/assertRevert');

const BigNumber = web3.BigNumber;

const MintedCrowdsale = artifacts.require('MintedCrowdsaleImpl');
const MintableToken = artifacts.require('MintableToken');
const RBACMintableToken = artifacts.require('RBACMintableToken');
const StandardToken = artifacts.require('StandardToken');

contract('MintedCrowdsale', function ([_, investor, wallet, purchaser]) {
const rate = new BigNumber(1000);
Expand Down Expand Up @@ -40,4 +42,19 @@ contract('MintedCrowdsale', function ([_, investor, wallet, purchaser]) {

shouldBehaveLikeMintedCrowdsale([_, investor, wallet, purchaser], rate, value);
});

describe('using non-mintable token', function () {
beforeEach(async function () {
this.token = await StandardToken.new();
this.crowdsale = await MintedCrowdsale.new(rate, wallet, this.token.address);
});

it('rejects bare payments', async function () {
await assertRevert(this.crowdsale.send(value));
});

it('rejects token purchases', async function () {
await assertRevert(this.crowdsale.buyTokens(investor, { value: value, from: purchaser }));
});
});
});
1 change: 0 additions & 1 deletion test/crowdsale/RefundableCrowdsale.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ contract('RefundableCrowdsale', function ([_, owner, wallet, investor, purchaser
it('should deny refunds', async function () {
await expectThrow(this.crowdsale.claimRefund({ from: investor }), EVMRevert);
});

});

context('after opening time', function () {
Expand Down