Skip to content

Instantly share code, notes, and snippets.

@MrCrambo
Created April 24, 2018 12:49
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/3d714eff3bbff3a51c93412af66e17da to your computer and use it in GitHub Desktop.
Save MrCrambo/3d714eff3bbff3a51c93412af66e17da to your computer and use it in GitHub Desktop.
describe('approve', function () {
const amount = 100;
it('approves the requested amount', async function () {
await this.token.approve(this.to, amount, { from: this.owner });
const allowance = await this.token.allowance(this.owner, this.to);
assert.equal(allowance, amount);
});
it('approves the requested amount and replaces the previous one', async function () {
await this.token.approve(this.to, 1, { from: this.owner });
await this.token.approve(this.to, amount, { from: this.owner });
const allowance = await this.token.allowance(this.owner, this.to);
assert.equal(allowance, amount);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment