@@ -177,4 +177,28 @@ contract('VanityURL', function(accounts) {
177
177
assert . isUndefined ( error , "owner should be able to call reserveVanityURLByOwner and assign a vanity to any address" )
178
178
} )
179
179
} ) ;
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
+ } ) ;
180
204
} ) ;
0 commit comments