Skip to content

Commit

Permalink
Fixed grammar and added tests to cover the last 1%
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeshultz committed Aug 28, 2017
1 parent eb6ca42 commit 40cf9fd
Showing 1 changed file with 37 additions and 1 deletion.
38 changes: 37 additions & 1 deletion test/gointomigration.errors.js
Expand Up @@ -8,7 +8,7 @@ contract("GointoMigration", function(accounts) {
var mary = accounts[3];
var whoever = accounts[4];

it("should not not allow a random user to set a contract", function() {
it("should not allow a random user to set a contract", function() {

var mig;

Expand All @@ -26,6 +26,42 @@ contract("GointoMigration", function(accounts) {

});

it("should not allow a key longer than 32 characters for contract storage", function() {

var mig;

return GointoMigration.deployed().then(function(instance) {

mig = instance;

return mig.setContract("iamalongkeyjustlongenoughtopass32", whoever, {from: manager});

})
.then(assert.fail)
.catch(function(err) {
assert(err.message.indexOf('invalid opcode') >= 0, "should have thrown invalid opcode");
});

});

it("should not be able to fetch a key longer than 32 characters", function() {

var mig;

return GointoMigration.deployed().then(function(instance) {

mig = instance;

return mig.getContract("iamalongkeyjustlongenoughtopass32");

})
.then(assert.fail)
.catch(function(err) {
assert(err.message.indexOf('invalid opcode') >= 0, "should have thrown invalid opcode");
});

});

it("should not not allow a random user to add an admin", function() {

var mig;
Expand Down

0 comments on commit 40cf9fd

Please sign in to comment.