Skip to content

Instantly share code, notes, and snippets.

@MrCrambo
Last active April 24, 2018 12:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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