Javi Martín
20b1085dc8
Simplify budget stats data generation
...
Configuring associations in the factories makes it easier to generate
headings, polls and ballots in the tests.
2019-05-21 13:50:17 +02:00
Javi Martín
8f69113233
Add poll stats by geozone and channel
2019-05-21 13:50:17 +02:00
Javi Martín
202fb44008
Add poll stats by age and channel
2019-05-21 13:50:17 +02:00
Javi Martín
7b408a4b88
Add poll stats by gender and channel
2019-05-21 13:50:17 +02:00
Javi Martín
90fe746d27
Add geozone stats to polls
2019-05-21 13:50:16 +02:00
Javi Martín
a552645e7f
Add tests to poll stats
...
While we already had "one test to rule all stats", testing each method
individually makes reading, adding and changing tests easier.
Note we need to make all methods being tested public. We could also test
them using methods like `stats.generate[:total_valid_votes]` instead of
`stats.total_valid_votes`, but then the tests would be more difficult to
read.
2019-05-21 13:50:16 +02:00
Javi Martín
4d520a3a47
Rename age_groups method
...
The name was confusing because it seemed to return a list of age groups.
2019-05-21 13:50:16 +02:00
Javi Martín
57a2945590
Use let for stats in budget stats spec
...
The rest of the `before` block still uses instance variables, but at
least the rest of the file doesn't use instance variables anymore.
2019-05-21 13:50:15 +02:00
Javi Martín
9a01ff5323
Refactor age groups method
...
We try to make the method return data which is easier to handle in the
view.
2019-05-21 13:50:15 +02:00
Javier Martín
cbfa2c1df8
Merge pull request #3504 from consul/backport-poll_slugs
...
Add slug to polls
2019-05-21 13:42:47 +02:00
Bertocq
ba9346162c
Improve officing result specs
2019-05-21 13:26:44 +02:00
Javi Martín
e461c8d0ac
Generate navigation links for polls without a slug
2019-05-21 13:04:26 +02:00
Alberto
1c10c22b08
Merge pull request #3509 from consul/menu-users
...
Users menu
2019-05-21 12:54:42 +02:00
Alberto
0b437d65fc
Merge pull request #3508 from consul/admin-ui
...
Improve help texts on Admin UI
2019-05-21 12:53:43 +02:00
decabeza
43dd3d2169
Include mailer header logo on custom images list
2019-05-21 11:22:04 +02:00
Alberto
7db1cac3bc
Merge pull request #3507 from consul/proposals-user-segment
...
Proposals authors user segment
2019-05-20 14:00:15 +02:00
decabeza
cbbe188d6a
Move officing link inside header dropdown menu
...
Also include the condition to hide this link on officing namespace.
2019-05-17 17:48:43 +02:00
decabeza
6cfb2e896d
Change admin menu to menu
2019-05-17 17:47:46 +02:00
decabeza
f06cdc5fbb
Change my activity menu to my content
2019-05-17 17:47:40 +02:00
decabeza
035b11c460
Hide select text if budget finished
2019-05-17 17:42:58 +02:00
decabeza
625c34bac2
Add officer email on admin poll shifts table
2019-05-17 17:41:42 +02:00
decabeza
0c704c2f06
Replace i18n destroy to delete
2019-05-17 17:41:38 +02:00
Alberto
d845c6e973
Merge pull request #3476 from consul/delete-poll
...
Allow delete polls with associated questions and answers
2019-05-17 17:38:20 +02:00
decabeza
e6af2f15fb
Add new user segment all_proposals_authors
2019-05-17 17:22:29 +02:00
Alberto
7c79965547
Merge pull request #3397 from consul/proposals-form
...
Remove question and external_url fields from proposals and legislation proposals
2019-05-17 17:08:56 +02:00
María Checa
0c6e7e7580
Adds Sluggable concern to Poll model
2019-05-17 05:41:09 +02:00
María Checa
e3b16230e6
Added slug to polls for named urls
2019-05-16 23:40:50 +02:00
María Checa
fac99cfb10
Add web and booth participants in budget stats
2019-05-16 22:01:42 +02:00
María Checa
c2457e36a5
Add budget stats permissions for normal users and admins
2019-05-16 22:01:42 +02:00
Marko Lovic
70e108d593
Simplify spec
2019-05-16 22:01:42 +02:00
Marko Lovic
0c5f801c19
Keep DB clean after running budget stats spec
...
This spec was leaving the DB "dirty" because it was creating
records in a before(:all) hook. These records are not cleaned up
automatically when using the :transaction strategy for DatabaseCleaner.
Using before(:each), however, causes another problem. Some of the code
depends on the heading id being 1 (see app/models/budget/ballot/line.rb#L48).
Because of SQL auto-increment, this is only the case the first time the hook
is run, as different id's are assigned on subsequent runs. This is fixed
by forcing the id to always be 1.
2019-05-16 22:01:42 +02:00
María Checa
3291b3274a
Added physical votes to stats
2019-05-16 22:01:42 +02:00
kikito
71fd3657d3
makes all users old enough to vote by default when created for the specs
2019-05-16 22:00:51 +02:00
Javier Martín
668b6cfd73
Merge pull request #3499 from consul/backport-admin_stats
...
Add admin budget stats
2019-05-16 20:41:39 +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
Javier Martín
c39a3d7525
Merge pull request #3492 from consul/backport-fix_delete_budget_with_polls
...
Don't destroy budgets with an associated poll
2019-05-16 13:07:18 +02:00
decabeza
e026412389
Add button to delete a poll
2019-05-14 16:46:56 +02:00
Javi Martín
1b323383a8
Don't destroy budgets with an associated poll
...
We were getting an exception due to foreign key database violations.
2019-05-13 13:44:58 +02:00
Javi Martín
9c991297c5
Fix typo
2019-05-13 13:44:58 +02:00
Alberto
60c02cc19a
Merge pull request #3466 from consul/admin-documents
...
Add document uploads from admin section
2019-05-10 17:57:22 +02:00
Javier Martín
9c02f5d0c2
Merge pull request #3486 from consul/backport-fix_typo_in_executions_spec
...
Fix typo in budget executions spec
2019-05-10 17:09:46 +02:00
Javier Martín
48b8e0f9da
Merge pull request #3487 from consul/backport-fix_widget_card_order
...
Remove unused (and flaky) card code and its spec
2019-05-10 17:09:23 +02:00
Javi Martín
574bd87b08
Remove unused (and flaky) card code and its spec
...
This code was introduced in commit 722a431b , but it stopped being used
in commit 7657a0e0 .
The spec was failing sometimes because the method didn't order the
records, but the spec checked the records returned in a certain order.
Furthermore, the method `page` generated a potential conflict with
kaminari's `page method.
2019-05-10 15:21:58 +02:00
Javi Martín
5812779974
Fix typo in budget executions spec
...
We were expecting the page not to have content which is actually there.
The test passed (most of the time) because before clicking the
"Milestones" link the content was not present, and we checked the page
content before the AJAX request generated by clicking the link had
finished.
2019-05-10 15:17:34 +02:00