Skip to content

Instantly share code, notes, and snippets.

@MrCrambo
Last active April 24, 2018 12:51
Show Gist options
  • Save MrCrambo/19d6e6dd7f0d355bacefb706a689bdc0 to your computer and use it in GitHub Desktop.
Save MrCrambo/19d6e6dd7f0d355bacefb706a689bdc0 to your computer and use it in GitHub Desktop.
describe('transfer from', function () {
beforeEach(async function () {
await this.token.approve(this.spender, 99, { from: this.owner });
});
describe('when the owner has enough balance', function () {
const amount = 100;
it('reverts', async function () {
await assertRevert(this.token.transferFrom(this.owner, this.to, amount, { from: this.owner }));
});
});
describe('when the owner does not have enough balance', function () {
const amount = 101;
it('reverts', async function () {
await assertRevert(this.token.transferFrom(this.owner, this.to, amount, { from: this.owner }));
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment