@@ -116,6 +116,31 @@ contract('VoteInOrganizationScheme', accounts => {
116
116
assert . equal ( tx . logs [ 0 ] . args . _vote , 1 ) ;
117
117
} ) ;
118
118
119
+ it ( "proposeVote vote not an option" , async function ( ) {
120
+ var testSetup = await setup ( accounts ) ;
121
+
122
+ var anotherTestSetup = await setup ( accounts ) ;
123
+ var absoluteVoteExecuteMock = await AbsoluteVoteExecuteMock . new ( ) ;
124
+ await absoluteVoteExecuteMock . initialize ( testSetup . org . reputation . address ,
125
+ anotherTestSetup . voteInOrganizationParams . votingMachine . absoluteVote . address ) ;
126
+
127
+ var tx = await absoluteVoteExecuteMock . propose ( 2 ,
128
+ anotherTestSetup . voteInOrganizationParams . votingMachine . params ,
129
+ anotherTestSetup . org . avatar . address ,
130
+ accounts [ 0 ] , helpers . NULL_ADDRESS ) ;
131
+
132
+ const proposalId = await helpers . getProposalId ( tx , anotherTestSetup . voteInOrganizationParams . votingMachine . absoluteVote , 'NewProposal' ) ;
133
+ try {
134
+ await testSetup . voteInOrganization . proposeVote (
135
+ anotherTestSetup . voteInOrganizationParams . votingMachine . absoluteVote . address ,
136
+ proposalId , 3 , helpers . NULL_HASH
137
+ ) ;
138
+ assert ( false , "vote not an option" ) ;
139
+ } catch ( error ) {
140
+ helpers . assertVMException ( error ) ;
141
+ }
142
+ } ) ;
143
+
119
144
it ( "proposeVote vote not in range" , async function ( ) {
120
145
var standardTokenMock = await ERC20Mock . new ( accounts [ 0 ] , 1000 ) ;
121
146
var testSetup = await setup ( accounts , 0 , true , standardTokenMock . address ) ;
0 commit comments