@@ -195,6 +195,29 @@ contract('SchemeRegistrar', accounts => {
195195 var organizationProposal = await testSetup . schemeRegistrar . organizationsProposals ( testSetup . org . avatar . address , proposalId ) ;
196196 assert . equal ( organizationProposal [ 2 ] , 0 ) ; //proposalType
197197 } ) ;
198+
199+ it ( "cannot propose in removed scheme" , async function ( ) {
200+ var testSetup = await setup ( accounts ) ;
201+
202+ var tx = await testSetup . schemeRegistrar . proposeToRemoveScheme ( testSetup . org . avatar . address , testSetup . schemeRegistrar . address , helpers . NULL_HASH ) ;
203+ var proposalId = await helpers . getValueFromLogs ( tx , '_proposalId' , 1 ) ;
204+ var controller = await Controller . at ( await testSetup . org . avatar . owner ( ) ) ;
205+ assert . equal ( await controller . isSchemeRegistered ( testSetup . schemeRegistrar . address , testSetup . org . avatar . address ) , true ) ;
206+ //Vote with reputation to trigger execution
207+ await testSetup . schemeRegistrarParams . votingMachine . absoluteVote . vote ( proposalId , 1 , 0 , helpers . NULL_ADDRESS , { from :accounts [ 2 ] } ) ;
208+ assert . equal ( await controller . isSchemeRegistered ( testSetup . schemeRegistrar . address , testSetup . org . avatar . address ) , false ) ;
209+ //check organizationsProposals after execution
210+ var organizationProposal = await testSetup . schemeRegistrar . organizationsProposals ( testSetup . org . avatar . address , proposalId ) ;
211+ assert . equal ( organizationProposal [ 2 ] , 0 ) ; //proposalType
212+
213+ try {
214+ await testSetup . schemeRegistrar . proposeToRemoveScheme ( testSetup . org . avatar . address , testSetup . schemeRegistrar . address , helpers . NULL_HASH ) ;
215+ assert ( false , "should fail to propose to unregistered scheme" ) ;
216+ } catch ( ex ) {
217+ helpers . assertVMException ( ex ) ;
218+ }
219+ } ) ;
220+
198221 it ( "execute proposeScheme and execute -yes - autoRegisterOrganization==TRUE arc scheme" , async function ( ) {
199222 var testSetup = await setup ( accounts ) ;
200223
0 commit comments