All tests now use account names, and dont use accounts[0] (except ERC… (#1137)
* All tests now use account names, and dont use accounts[0] (except ERC721) * Added account names to some missing contracts.
This commit is contained in:
@ -10,24 +10,21 @@ require('chai')
|
||||
|
||||
const ConditionalEscrowMock = artifacts.require('ConditionalEscrowMock');
|
||||
|
||||
contract('ConditionalEscrow', function (accounts) {
|
||||
const owner = accounts[0];
|
||||
|
||||
contract('ConditionalEscrow', function ([_, owner, payee, ...otherAccounts]) {
|
||||
beforeEach(async function () {
|
||||
this.escrow = await ConditionalEscrowMock.new({ from: owner });
|
||||
});
|
||||
|
||||
context('when withdrawal is allowed', function () {
|
||||
beforeEach(async function () {
|
||||
await Promise.all(accounts.map(payee => this.escrow.setAllowed(payee, true)));
|
||||
await Promise.all(otherAccounts.map(payee => this.escrow.setAllowed(payee, true)));
|
||||
});
|
||||
|
||||
shouldBehaveLikeEscrow(owner, accounts.slice(1));
|
||||
shouldBehaveLikeEscrow(owner, otherAccounts);
|
||||
});
|
||||
|
||||
context('when withdrawal is disallowed', function () {
|
||||
const amount = web3.toWei(23.0, 'ether');
|
||||
const payee = accounts[1];
|
||||
|
||||
beforeEach(async function () {
|
||||
await this.escrow.setAllowed(payee, false);
|
||||
|
||||
Reference in New Issue
Block a user