@@ -519,6 +519,28 @@ contract('Competition', accounts => {
519519
520520 } ) ;
521521
522+ it ( "cannot redeem after the REDEMPTION_PERIOD" , async function ( ) {
523+ var testSetup = await setup ( accounts ) ;
524+ await testSetup . standardTokenMock . transfer ( testSetup . org . avatar . address , 30 , { from :accounts [ 1 ] } ) ;
525+ await web3 . eth . sendTransaction ( { from :accounts [ 0 ] , to :testSetup . org . avatar . address , value :20 } ) ;
526+ var proposalId = await proposeCompetition ( testSetup ) ;
527+ await helpers . increaseTime ( 20 ) ;
528+ await testSetup . competition . suggest ( proposalId , "suggestion" , helpers . NULL_ADDRESS ) ;
529+ await testSetup . contributionRewardExtParams . votingMachine . absoluteVote . vote ( proposalId , 1 , 0 , helpers . NULL_ADDRESS , { from :accounts [ 2 ] } ) ;
530+ await testSetup . contributionRewardExtParams . votingMachine . absoluteVote . vote ( proposalId , 1 , 0 , helpers . NULL_ADDRESS , { from :accounts [ 0 ] } ) ;
531+ await testSetup . contributionRewardExt . redeem ( proposalId , [ true , true , true , true ] ) ;
532+ await helpers . increaseTime ( 650 ) ;
533+ await testSetup . competition . vote ( 1 , { from :accounts [ 1 ] } ) ;
534+ await helpers . increaseTime ( 650 + 7776000 + 1 ) ;
535+ try {
536+ await testSetup . competition . redeem ( 1 ) ;
537+ assert ( false , 'cannot redeem after the REDEMPTION_PERIOD' ) ;
538+ } catch ( ex ) {
539+ helpers . assertVMException ( ex ) ;
540+ }
541+
542+ } ) ;
543+
522544 it ( "negative reputation change is not allowed" , async function ( ) {
523545 var testSetup = await setup ( accounts ) ;
524546 try {
@@ -606,7 +628,7 @@ contract('Competition', accounts => {
606628
607629 try {
608630 await testSetup . competition . sendLeftOverFunds ( proposalId ) ;
609- assert ( false , 'cannot sendLeftOverFunds because not all proposals redeemed yet ' ) ;
631+ assert ( false , 'cannot sendLeftOverFunds because redeemed period is still on ' ) ;
610632 } catch ( ex ) {
611633 helpers . assertVMException ( ex ) ;
612634 }
@@ -618,7 +640,7 @@ contract('Competition', accounts => {
618640 assert . equal ( tx . logs [ 0 ] . args . _rewardPercentage , 53 ) ;
619641
620642 var proposal = await testSetup . contributionRewardExt . organizationProposals ( proposalId ) ;
621-
643+ await helpers . increaseTime ( 7776000 ) ;
622644 tx = await testSetup . competition . sendLeftOverFunds ( proposalId ) ;
623645 await testSetup . contributionRewardExt . getPastEvents ( 'RedeemExternalToken' , {
624646 fromBlock : tx . blockNumber ,
0 commit comments