Restructure test
This commit is contained in:
@ -1,6 +1,7 @@
|
|||||||
contract('Bounty', function(accounts) {
|
contract('Bounty', function(accounts) {
|
||||||
it("can create bounty contract with factory address", function(done){
|
it("can create bounty contract with factory address", function(done){
|
||||||
var target = SecureTargetMock.deployed();
|
var target = SecureTargetMock.deployed();
|
||||||
|
|
||||||
SimpleTokenBounty.new(target.address).
|
SimpleTokenBounty.new(target.address).
|
||||||
then(function(bounty){
|
then(function(bounty){
|
||||||
return bounty.factoryAddress.call()
|
return bounty.factoryAddress.call()
|
||||||
@ -11,9 +12,12 @@ contract('Bounty', function(accounts) {
|
|||||||
then(done);
|
then(done);
|
||||||
})
|
})
|
||||||
|
|
||||||
it("can call checkInvariant for SecureTargetMock", function(done){
|
describe("SecureTargetMock", function(){
|
||||||
var bounty;
|
before(function(){
|
||||||
var targetFactory = SecureTargetFactory.deployed();
|
targetFactory = SecureTargetFactory.deployed();
|
||||||
|
})
|
||||||
|
|
||||||
|
it("checkInvariant returns true", function(done){
|
||||||
SimpleTokenBounty.new(targetFactory.address).
|
SimpleTokenBounty.new(targetFactory.address).
|
||||||
then(function(_bounty) {
|
then(function(_bounty) {
|
||||||
bounty = _bounty;
|
bounty = _bounty;
|
||||||
@ -27,10 +31,14 @@ contract('Bounty', function(accounts) {
|
|||||||
}).
|
}).
|
||||||
then(done);
|
then(done);
|
||||||
})
|
})
|
||||||
|
})
|
||||||
|
|
||||||
it("can call checkInvariant for InsecureTargetMock", function(done){
|
describe("InsecureTargetMock", function(){
|
||||||
var bounty;
|
before(function(){
|
||||||
var targetFactory = InsecureTargetFactory.deployed();
|
targetFactory = InsecureTargetFactory.deployed();
|
||||||
|
})
|
||||||
|
|
||||||
|
it("checkInvariant returns false", function(done){
|
||||||
SimpleTokenBounty.new(targetFactory.address).
|
SimpleTokenBounty.new(targetFactory.address).
|
||||||
then(function(_bounty) {
|
then(function(_bounty) {
|
||||||
bounty = _bounty;
|
bounty = _bounty;
|
||||||
@ -44,4 +52,5 @@ contract('Bounty', function(accounts) {
|
|||||||
}).
|
}).
|
||||||
then(done);
|
then(done);
|
||||||
})
|
})
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user