Commit Graph

21 Commits

Author SHA1 Message Date
Javi Martín
19a41eb651 Rename trait with_answers to yes_no
We barely use this trait. In the votation type spec we're probably using
it wrong, and in the answer spec we assume one of the answers is going
to be "Yes".

The name `yes_no` is more expressive, since it makes it clear what the
answers are.
2019-09-24 21:34:06 +02:00
Javi Martín
2b2c528098 Use hidden trait in specs
We were using it in most places, but there were a few where we still
used `hidden_at: Time.current`.
2019-09-24 21:34:06 +02:00
Javi Martín
cb2069858c Remove unnecessary code
It looks like these variables were left by accident. The Ruby
interpreter was giving us warnings about unused variables.
2019-09-24 18:49:40 +02:00
Julian Herrero
fd71ed825b Avoid error when accessing final votes stats before balloting phase
When accessing the URL `/admin/stats/budget_balloting?budget_id=X'
for a budget in a phase prior to the balloting phase, the following
error was raised due to the stats where not calculated yet.
Instead, we'll now show a flash message.

NoMethodError:
  undefined method `[]' for nil:NilClass
  ./app/controllers/admin/stats_controller.rb:82
2019-06-10 17:28:16 +02:00
voodoorai2000
d0b8fef6b3 Delete spending proposals 2019-05-31 18:22:59 +02:00
Javi Martín
307cf24846 Use describe on feature tests
The `type: :feature` is automatically detected by RSpec because these
tests are inside the `spec/features` folder. Using `feature` re-adds a
`type: :feature` to these files, which will result in a conflict when we
upgrade to Rails 5.1's system tests.

Because of this change, we also need to change `background` to `before`
or else these tests will fail.
2019-05-28 16:36:54 +02:00
Juanjo Bazán
f22a97468b makes code heading_id agnostic 2019-05-16 14:45:46 +02:00
Juanjo Bazán
110ee961e3 adds budget stats for final voting to admin stats 2019-05-16 14:45:46 +02:00
Juanjo Bazán
5be54b57da reduces current admin budget stats as supporting phase 2019-05-16 14:45:45 +02:00
rgarcia
11437a1d40 add budget investment stats 2019-05-16 13:41:49 +02:00
rgarcia
be757f79d0 cleans up 2019-05-16 13:37:47 +02:00
rgarcia
b628631769 fixes specs 2019-05-16 13:37:47 +02:00
rgarcia
1f8d19c8ba adds basic graph specs 2019-05-16 13:37:47 +02:00
Julian Herrero
31ac8b7f55 Change single quotes to double quotes 2019-02-15 11:40:39 +01:00
rgarcia
e3eb87addb checks for deleted proposals 2019-01-04 15:25:13 +01:00
Angel Perez
ffe421ae69 Replace .all.each with .find_each on admin specs 2018-09-10 11:40:24 -04:00
iagirre
3815e20506 Specs for admins polls stats added 2017-10-23 16:48:50 +02:00
rgarcia
b1fa2d22f7 only count active users in stats 2017-06-13 12:59:04 +02:00
rgarcia
f9a2f5d5dc adds specs for stats 2016-06-16 17:59:56 +02:00
kikito
3ad5fa19e5 Fixes failing specs after adding geozones to residence verifications 2016-02-19 18:29:14 +01:00
Juanjo Bazán
3a51145bc9 moves existent stats specs to admin namespace 2016-02-08 14:16:06 +01:00