Commit Graph

63 Commits

Author SHA1 Message Date
Javi Martín
aeb1655961 Use budget phase traits
We were already using them in many places, but not everywhere.
2019-09-24 21:34:06 +02:00
Javi Martín
44d137a4c0 Simplify translatable tests in admin section
These feature tests were taking too long, we can't run them for every
single model.

I'm taking the approach of using one different model for each test, but
in theory only using a few models covering every possible scenario
would be enough.
2019-09-23 18:01:44 +02:00
Javi Martín
c8c8a7bc30 Simplify investment creation in specs
Now factories define default headings for investments, so there's no
need to create a group and a heading to create an investment.

Likewise, in order to create a heading it isn't necessary to specify a
group anymore; specifying the budget is enough.

It's possible that there are more similar cases we haven't simplified
yet; I'm only addressing the obvious ones.
2019-09-23 16:51:30 +02:00
Javi Martín
f9ed186909 Add rubocop spacing rules
We were following these rules in most places; we just didn't define them
anywhere.
2019-09-10 21:04:56 +02:00
Javi Martín
488461b8ac Remove consecutive blank lines 2019-09-10 20:02:15 +02:00
Senén Rodero Rodríguez
f7417d6479 Adapt specs to new translations interface markup 2019-07-01 14:49:43 +02:00
Senén Rodero Rodríguez
3176be43d9 Rename "translatable" shared example to "edit_translatable"
Also rename all specs calls
2019-06-27 09:20:25 +02:00
Julian Herrero
b122302c58 Use find instead of find_by_id
Better raise a 404 HTML NotFound exception than any other unexpected error.
2019-06-03 17:54:19 +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
Javi Martín
e3d6dbacab Simplify finished budget factory creation 2019-05-22 11:50:03 +02:00
decabeza
0c704c2f06 Replace i18n destroy to delete 2019-05-17 17:41:38 +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
lalo
237a03552f Move admin budget investments tabs filters to advanced filters component 2019-04-03 22:27:48 +02:00
Julian Herrero
c82b2a975a Add new settings tab for participation processes
- Rename setting keys
- New tab por participation processes
- Hide these settings from features tab
2019-03-19 19:45:32 +01:00
Julian Herrero
d76782f150 Make budgets translatable 2019-02-13 11:41:58 +01:00
Alberto
938d5eba43 Merge pull request #3191 from consul/ui-i18n-details
Fix i18n and UI minor details
2019-02-13 10:55:03 +01:00
decabeza
e8ad9f749e Fix hound warnings 2019-02-11 17:33:51 +01:00
decabeza
5974b7ee84 Update calculate winners button on budgets form 2019-02-05 17:15:26 +01:00
decabeza
75531c6c80 Show current phase as selected on phase select on admin budgets form 2019-01-23 14:30:35 +01:00
decabeza
d93fd07bb7 Update there are no budget i18n to add consistency 2019-01-16 14:32:20 +01:00
Julian Herrero
6439be44f1 change CRUD for budget groups and headings
To make it more consistent with the rest of the Admin panel,
the CRUD for budget groups and headings has been changed
from the old "all-in-one" form to a separate form for each resource.
2018-12-14 16:34:54 +01:00
Matheus Miranda
06f07b1139 Add map to sidebar on Heading's page
Signed-off-by: Matheus Miranda <matheusmirandalacerda@gmail.com>
2018-11-16 09:05:23 +01:00
decabeza
c049be6dae Improves message when there are no budgets 2018-11-06 18:11:13 +01:00
iagirre
73b0fe5162 Modified feature spec to pass with the new UI
Add feature spec to test if the 'Calculate winners'
button is enabled or not, depending on the phase.
It also checks the message that clarifies why the
button is disabled.
2018-05-29 10:27:16 +02:00
Antonis Tzorvas
c21d806ecc Refs #2603 Show 'See Results' button in admin panel 2018-05-19 13:38:02 +03:00
Angel Perez
eb2926ab42 Fix failing scenario related to Headless Chrome window-size flag 2018-03-27 14:47:50 -04:00
rgarcia
6f4d23fdef Remove circular argument reference warning
We were seeing this warning when running specs
`spec/features/admin/budgets_spec.rb:322: warning: circular argument
reference - phase_kind`

This commit should fix the warning
2018-02-06 12:22:34 +01:00
Bertocq
2a500a14bc Make budget admin feature spec linelenght compliant 2018-01-24 01:20:29 +01:00
Bertocq
bd64c4749f Update groups & headings management feature spec 2018-01-24 01:17:38 +01:00
Bertocq
cc69225b7a Assert phases list order in admins budget edit form 2018-01-23 00:15:06 +01:00
Bertocq
8eaf0982b1 Fixed Admin Budget's destroy button to a link
Why:

The Admin Budget form has a submit button for saving the record, adding
another submit input to destroy the record actually adds to the html:
`<input type="hidden" name="_method" value="delete">` and it collides
with the save button, forcing it to perform a destroy instead of save.

Previously the destroy button was not in the same div as the save button

How:
Just changing the Destroy from a button_to to a link_to.
2018-01-20 14:03:14 +01:00
María Checa
94279448f3 Replaced 'participatory budget' with 'budget' 2018-01-20 14:03:14 +01:00
María Checa
2fd53d6394 Added admin budget phases tests 2018-01-20 14:03:13 +01:00
Bertocq
a2b950d8de Fix to_not to not_to on rspec expectations 2018-01-17 00:03:23 +01:00
iagirre
0e11e21b2a Merged with master and solved conflicts 2018-01-10 13:23:39 +01:00
BertoCQ
6e96c8c057 Merge branch 'master' into feature/2275#destroy_budgets 2018-01-09 11:03:51 +01:00
BertoCQ
01c41c7cca Merge pull request #2284 from consul/feature/2276#admin_budget_edit_redirect
Redirect admin to budget lists after edit
2018-01-09 10:50:54 +01:00
Bertocq
63694b5bae Increase admin budget feature spec for drafting phase 2018-01-08 22:52:56 +01:00
Bertocq
53842ba919 Add Update scenario to admin budget feature spec 2018-01-08 18:46:50 +01:00
Bertocq
51e3d75c62 Add destroy scenario to budget section of admin panel 2018-01-08 17:48:06 +01:00
Bertocq
34bb9d65b1 Enable RSpec/NotToNot cop and fix all issues
Read about cop at http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/NotToNot
2018-01-07 17:39:48 +01:00
iagirre
f7e96067b0 Actions for budgets' headings added. Edit headings, delete headings if not budget investments associated and add link in order to see budgets investments filtered by the heading.
Cambios para hacer commit:
	modificado:    app/controllers/admin/budget_headings_controller.rb
	modificado:    app/models/budget/heading.rb
	nuevo archivo: app/views/admin/budget_headings/_errors.html.erb
	nuevo archivo: app/views/admin/budget_headings/edit.js.erb
	nuevo archivo: app/views/admin/budget_headings/update.js.erb
	modificado:    app/views/admin/budgets/_group.html.erb
	nuevo archivo: app/views/admin/budgets/_heading.html.erb
	nuevo archivo: app/views/admin/budgets/_heading_form.html.erb
	modificado:    config/locales/en/activerecord.yml
	modificado:    config/locales/es/activerecord.yml
	modificado:    spec/features/admin/budgets_spec.rb
	modificado:    spec/models/budget/heading_spec.rb
2017-09-25 15:40:17 +02:00
Bertocq
57f476c2fa Merge branch 'master' into feature/add_population_to_budget_heading 2017-06-27 18:43:24 +02:00
Bertocq
51f8975654 Increase admin budget spec feature to check Budget Heading creation allows to set population value 2017-06-25 15:47:46 +02:00
Bertocq
ee9d3cd7e3 Add a scenario for the Calculate Budgets winner investment feature on admin budget spec 2017-06-25 15:47:04 +02:00
Bertocq
798b646135 Cleanup Settings values modified after specs are run 2017-06-07 20:55:42 +02:00
Juanjo Bazán
d2129bf926 fixes spec 2017-03-23 13:06:09 +01:00
Alberto Garcia Cabeza
8722699cd8 fixes typos and spec for budgets investments 2017-01-08 22:17:14 +01:00
kikito
5f108944a8 final attempt at fixing travis 2017-01-05 12:49:53 +01:00