Skip to content

Commit 71bfd05

Browse files
authored
Merge pull request #15 from SpringRole/change-vanity-testcase
Change vanity testcase
2 parents 4825f74 + 4a8e43a commit 71bfd05

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

test/2_vanity.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,4 +177,28 @@ contract('VanityURL', function(accounts) {
177177
assert.isUndefined(error,"owner should be able to call reserveVanityURLByOwner and assign a vanity to any address")
178178
})
179179
});
180+
181+
it("should error on change vanityURL when address has no vanity", function() {
182+
return vanityInstance.changeVanityURL('noassigned',{from:accounts[5]}).then(function(instance){
183+
assert.isUndefined(instance,"should error on change vanityURL when not assigned")
184+
}).catch(function(error){
185+
assert.isDefined(error,"should error on change vanityURL when not assigned")
186+
})
187+
});
188+
189+
it("should error on change vanityURL when vanity is in use", function() {
190+
return vanityInstance.changeVanityURL('vinay035',{from:accounts[3]}).then(function(instance){
191+
assert.isUndefined(instance,"should error on change vanityURL when not assigned")
192+
}).catch(function(error){
193+
assert.isDefined(error,"should error on change vanityURL when not assigned")
194+
})
195+
});
196+
197+
it("should be able to change vanityURL", function() {
198+
return vanityInstance.changeVanityURL('vinay0351',{from:accounts[3]}).then(function(instance){
199+
assert.isDefined(instance,"should be able to change vanityURL")
200+
}).catch(function(error){
201+
assert.isUndefined(error,"should be able to change vanityURL")
202+
})
203+
});
180204
});

0 commit comments

Comments
 (0)