Commit Graph

55 Commits

Author SHA1 Message Date
Javi Martín
7b0771106e Remove isolated useless assignments
These variables are not surrounded by other assignments, and so they can
safely be removed without making it harder to read the code vertically.
2019-09-25 12:43: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
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
241ee313f1 Use paths instead of URLs where possible
It simplifies the code and solves any issue we might have configuring
the host in the test environment.
2019-05-28 16:38:45 +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
2b4e1cf358 Add missing double quotes
We overlooked a few single quotes while we changed thousands of them.
2019-03-25 13:22:35 +01:00
Julian Herrero
a963a99c55 Use correct scope to sort headings by name 2019-02-13 13:35:09 +01:00
Julian Herrero
29a704bd60 Show headings in budgets landing page when translations are missing 2019-02-13 13:35:09 +01:00
decabeza
7263401561 Remove duplicated budgets specs 2019-02-05 14:01:30 +01:00
decabeza
5409db6c55 Show only selected investments on map from publishing prices phase
If there are no selected investements show all investments on map.
2019-02-05 14:01:27 +01:00
decabeza
9edabb5bf4 Fix links on budgets index page 2019-01-30 14:15:40 +01:00
voodoorai2000
7917cea676 Change to_not for not_to
Eventhough some of us sentimentals still like the syntax `to_not` the current trend is to move to the new syntax `not_to`.

In this commit we are updating the references of expectations that used `to_not` to `not_to`.
2018-12-15 12:33:28 +01:00
Javi Martín
9bacf39647 Fix link to create a new budget investment 2018-11-06 13:19:34 +01:00
María Checa
2dd5fe22a8 Removes permissions for admins to access unfinished budget results 2018-07-26 11:07:19 +02:00
decabeza
56ee33d947 Removes content pending to backport 2018-06-08 19:46:07 +02:00
Alberto
f345786cc0 Merge pull request #2622 from consul/selected-investments-map
Adds message to selected budget investments
2018-06-06 19:21:24 +02:00
decabeza
0bf31bde6c Updates all active to is-active classes 2018-06-06 12:02:13 +02:00
Raimond Garcia
eea0c74707 Merge pull request #2654 from wairbut-m2c/backport/budgets-map-fixes
Budgets homepage map fixes
2018-05-31 23:19:34 +02:00
María Checa
1169c10907 Add condition to show only selected investments in publishing_prices phase 2018-05-29 08:40:32 -04:00
Angel Perez
9575aa5a42 Fix failing specs for skipping invalid map markers 2018-05-28 11:44:53 -04:00
rgarcia
994e15666e Skip invalid map markers
Why:
Sometimes the latitude or longitude it passed to the map as *********
instead of the actual latitude or longitud. The asterisks are not a
string, breaking the whole array
https://github.com/consul/consul/issues/2380

What:
This commits skips invalid markers and displays the rest

How:
- Substituting the mysterious asterisks for null
(cleanInvestmentCoordinates)

- Validating the coordinates are numbers before trying to pain
them(validCoordinates)

- Adding a numeric function to validate the latitude and longitude
(isNumeric)
https://stackoverflow.com/questions/9716468/is-there-any-function-like-i
snumeric-in-javascript-to-validate-numbers#answer-9716488
2018-05-28 11:44:53 -04:00
decabeza
f1e722ac5c Adds message to selected budget investments 2018-05-10 14:54:34 +02:00
rgarcia
39c6ac4a91 Display message in budget's index when there are no budgets
When there are no budgets we were seeing an exception in the budgets’
index

There are two parts to take into account here:
1) Making sure there is a current_budget present, otherwise we display
the “no budgets” message

2) The map helper is called from the controller, so we need to make
sure current_budget is present there too

Note: We could have added a bunch of `try` statements in the budgets’s
index, instead of using a conditional, however there are quite a few
`current_budget` calls so it seems more appropriate to use a conditional
2018-04-05 14:25:32 +02:00
Raúl Fuentes
ecdbc4a3f7 added balloting to the list of phases allowed to see all the links 2018-02-10 15:27:40 +01:00
Raúl Fuentes
6871193cbc Added test to bugets/index to ensure the correcto showing of the investment links over ths changes of the buget's phase 2018-02-10 15:27:40 +01:00
Bertocq
04d5a83031 Improve Budget's index feature spec scenarios 2018-01-30 03:01:44 +01:00
Bertocq
e5cff2fb60 Make budget feature spec comply with 100 linelenght 2018-01-25 00:48:52 +01:00
Bertocq
bc3c92acb4 Remove no longer valid drafting budget scenarios
Drafting budgets will no longer be listed under any conditions at the
budget index... not even as "current" budget.
2018-01-25 00:48:52 +01:00
Bertocq
210032e1ce Expect finished budget be listed at budget index
But only finished budgets should be listed here, not drafting ones,
neither current ones.
2018-01-25 00:48:31 +01:00
Bertocq
d692ff781a Refactor Budget feature spec Index scenario
Budget's home page has changed, no longer we'll be showing a list of
active budgets, but only one current (open) budget and a list of
finished ones.

So no need to create 3 budgets in a row, but a finished budget (because
we already have a valid budget created)
2018-01-24 22:00:03 +01:00
iagirre
4bb872bef7 Fixed errors detected in Travis 2018-01-23 15:42:01 +01:00
Raúl Fuentes
82b750de68 moved duplicated code to helper 2018-01-23 15:42:01 +01:00
iagirre
846898f3ec New phase "Information" added and UI modified to not show the links.
Specs to test the functionality added.
2018-01-23 15:42:01 +01:00
iagirre
8f3df54453 Fixed errors detected in Travis 2018-01-23 13:33:10 +01:00
Bertocq
217f62116e Correctly scape budget phase summary on phases list 2018-01-22 23:29:48 +01:00
María Checa
1f461b09f0 Merge pull request #2353 from consul/2339-admin_budgets_phases
Allow admins to edit Budget phases
2018-01-22 18:07:34 +01:00
Raúl Fuentes
93268fc5d6 changed advanced filter from budgets to budgets/investments 2018-01-22 09:59:09 +01:00
Raúl Fuentes
bb39f8af0a issue #1436, mirrored behavior from proposals 2018-01-22 09:59:09 +01:00
María Checa
94279448f3 Replaced 'participatory budget' with 'budget' 2018-01-20 14:03:14 +01:00
decabeza
f722caac24 removes budget steps on header 2018-01-19 14:35:05 +01:00
rgarcia
8a669b86bd Fix English grammar in translations 2018-01-18 21:09:21 +01:00
Bertocq
e4e9a149b0 Update expectations after decreasing end date of budget phase 2018-01-18 17:18:05 +01:00
decabeza
b48fb7a41e adds specs 2018-01-18 17:18:05 +01:00
Bertocq
a6b06ca730 Improve Budget's homepage
* Add budget's phases number status
* Add budget's headings and groups list
* Placeholders for future improvements
2018-01-17 19:11:58 +01:00
Bertocq
2026f537e6 Add drafting phase scenario to budget feature spec for list & show checks 2018-01-08 22:51:01 +01:00
Bertocq
506293fc80 Move level two user creation to a shared let on budget feature 2018-01-08 19:59:14 +01:00
Bertocq
377a514128 Refactor commmon budget creation to a shared one at budget feature spec 2018-01-08 19:40:27 +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
Juanjo Bazán
81c4a13305 shows links to unfeasible/selected only after budget is balloting 2017-05-09 17:36:42 +02:00