test/Entropy_actions.jsView |
---|
4 | 4 … | |
5 | 5 … | * Actions |
6 | 6 … | * |
7 | 7 … | */ |
8 | | - it("stops untrusted Citizens from creating actions", (done) => { |
9 | | - helpers.deployEntropyContract() |
10 | | - .then((entropy) => { |
11 | | - return helpers.expectedExceptionPromise(() => { |
12 | | - return entropy.newAction(1e18, "Rigging refit", { from: accounts[1]}); |
13 | | - }, 3000000) |
14 | | - .then(()=>{ |
15 | | - entropy.actions_count().then((actions_count) => { |
16 | | - assert.equal(actions_count, 0); |
17 | | - done(); |
| 8 … | + |
| 9 … | + describe("Creating actions", () =>{ |
| 10 … | + it("stops untrusted Citizens from creating actions", (done) => { |
| 11 … | + helpers.deployEntropyContract() |
| 12 … | + .then((entropy) => { |
| 13 … | + return helpers.expectedExceptionPromise(() => { |
| 14 … | + return entropy.newAction(1e18, "Rigging refit", { from: accounts[1]}); |
| 15 … | + }, 3000000) |
| 16 … | + .then(()=>{ |
| 17 … | + entropy.actions_count().then((actions_count) => { |
| 18 … | + assert.equal(actions_count, 0); |
| 19 … | + done(); |
| 20 … | + }) |
18 | 21 … | }) |
19 | 22 … | }) |
20 | | - }) |
21 | | - }); |
| 23 … | + }); |
22 | 24 … | |
23 | | - it("lets trusted Citizens create actions", (done) => { |
24 | | - helpers.deployEntropyContract() |
25 | | - .then((entropy) => { |
26 | | - entropy.newAction(1e18, "Rigging refit").then((tx) => { |
27 | | - entropy.actions_count().then((actions_count) => { |
28 | | - assert.equal(actions_count, 1); |
| 25 … | + it("lets trusted Citizens create actions", (done) => { |
| 26 … | + helpers.deployEntropyContract() |
| 27 … | + .then((entropy) => { |
| 28 … | + entropy.newAction(1e18, "Rigging refit").then((tx) => { |
| 29 … | + entropy.actions_count().then((actions_count) => { |
| 30 … | + assert.equal(actions_count, 1); |
| 31 … | + }) |
| 32 … | + .then(()=>{ done() }) |
29 | 33 … | }) |
30 | | - .then(()=>{ done() }) |
31 | 34 … | }) |
32 | 35 … | }) |
33 | | - }); |
| 36 … | + }) |
| 37 … | + |
| 38 … | + describe("Voting", () =>{ |
| 39 … | + it("lets trusted citizens vote", (done) => { |
| 40 … | + helpers.deployEntropyContract() |
| 41 … | + .then((entropy) => { |
| 42 … | + entropy.newAction(1e18, "Rigging refit").then((tx) => { |
| 43 … | + entropy.actions_count().then((actions_count) => { |
| 44 … | + assert.equal(actions_count, 1); |
| 45 … | + }) |
| 46 … | + .then(()=>{ done() }) |
| 47 … | + }) |
| 48 … | + }) |
| 49 … | + }); |
| 50 … | + |
| 51 … | + }) |
| 52 … | + |
34 | 53 … | }) |