You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
943 B
38 lines
943 B
9 years ago
|
contract('Ownable', function(accounts) {
|
||
|
it("should have an owner", function(done) {
|
||
|
var ownable = Ownable.deployed();
|
||
|
return ownable.owner()
|
||
8 years ago
|
.then(function(owner) {
|
||
|
assert.isTrue(owner != 0);
|
||
|
})
|
||
|
.then(done)
|
||
9 years ago
|
});
|
||
9 years ago
|
|
||
9 years ago
|
it("changes owner after transfer", function(done) {
|
||
|
var ownable = Ownable.deployed();
|
||
8 years ago
|
var other = accounts[1];
|
||
9 years ago
|
return ownable.transfer(other)
|
||
8 years ago
|
.then(function() {
|
||
|
return ownable.owner();
|
||
|
})
|
||
|
.then(function(owner) {
|
||
|
assert.isTrue(owner === other);
|
||
|
})
|
||
|
.then(done)
|
||
9 years ago
|
});
|
||
8 years ago
|
|
||
|
it("should prevent non-owners from transfering" ,function(done) {
|
||
|
var ownable = Ownable.deployed();
|
||
|
var other = accounts[2];
|
||
|
return ownable.transfer(other, {from: accounts[2]})
|
||
8 years ago
|
.then(function() {
|
||
|
return ownable.owner();
|
||
|
})
|
||
|
.then(function(owner) {
|
||
|
assert.isFalse(owner === other);
|
||
|
})
|
||
|
.then(done)
|
||
8 years ago
|
});
|
||
|
|
||
9 years ago
|
});
|