Commit Graph

1791 Commits

Author SHA1 Message Date
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
Bertocq
d6a6b99624 Fix rare flaky test, expect a price not just the number 2018-01-24 15:06:40 +01:00
Bertocq
e0abb86267 Update specs for new heading options naming rules
* Update budget heading order scenario to check new option name rules
* Update other scenarios that were expecting old heading naming convention
2018-01-24 14:15:10 +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
Raimond Garcia
c96e8d1203 Merge pull request #2357 from consul/travis-logs
Clean up Travis logs
2018-01-23 21:31:29 +01:00
María Checa
1c2949b60d Merge pull request #2344 from wairbut-m2c/aperez-investments-filters
Improvements for Admin::Budget::Investment filters
2018-01-23 20:09:54 +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
e59ed81528 Return 404 accesing community without communitable
Why:

Somehow we're seeing communities without proposals at production. We
must find why and fix it, but first we need to throw a 404 at the user
instead of a 500 internal server error

How:

First catching the scenario of non-existent communitable at the
controller and raising a 404 error. Secondly preventing the author_id
access over a possibly nil object, this is a smell but it can't be
easily fixed right now... we need to correctly implement a relation
between Community and communitable and avoid the multiple occurences of
`community.from_proposal?` in the codebase that makes it impossible to
extend to a fourth communitable model.
2018-01-23 00:22:53 +01:00
Bertocq
cc69225b7a Assert phases list order in admins budget edit form 2018-01-23 00:15:06 +01:00
Bertocq
217f62116e Correctly scape budget phase summary on phases list 2018-01-22 23:29:48 +01:00
Angel Perez
1027896617 Reenable 'winners' tab under Admin::Budget::Investment 2018-01-22 14:04:57 -04:00
Angel Perez
a79e60ecd1 Add spec for Admin::Budget::Investment 'max_per_heading' filter 2018-01-22 14:04:56 -04:00
Angel Perez
dddf026a59 Adapt Admin::Budget::Investment failing specs to new filter UI 2018-01-22 14:04:56 -04: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
María Checa
b706f0c8bb Merge pull request #2142 from wairbut-m2c/rfuentes-add-advanced-menu-to-order-proposals
Add advanced search menu to investments list
2018-01-22 17:46:19 +01:00
rgarcia
8fb9be9d07 Fix RSpec's should deprecation warning
Using `stub` from rspec-mocks' old `:should` syntax without explicitly
enabling the syntax is deprecated. Use the new `:expect` syntax or
explicitly enable `:should` instead
2018-01-22 17:40:56 +01:00
Bertocq
155840a130 Sanitize & truncate text for socialmedia metatags
Why:

The html tags weren't removed from the text that was rendered at the
social metatags (twitter & facebook), neither scaped so adding a quoted
text would endup breaking the metatag content and writting in plain
sight the description at the browser view.

How:

Saniziting the text and truncating it afterwards since we don't need to
send more than 140 chars for twitter/facebook social cards.
2018-01-22 11:52:35 +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
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
7f6c1f4e97 Fix to_not for not_to in guides spec 2018-01-19 23:42:39 +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
rgarcia
d3d05f9cee Add guide to create a proposal or investment
During a Participatory Budget, some users are getting confused and
creating a proposal instead of a budget investment. This intermediate
page should help them create investments

Adding a feature flag just in case other forks don’t need this feature
and setting seeds and dev_seeds for appropriate initial setup
2018-01-18 21:09:21 +01:00
Bertocq
808c4eddfc Fix budget investment feature spec 2018-01-18 18:59:57 +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
María Checa
4d97d349a1 Added tests for alert 2018-01-17 19:11:48 +01:00
Bertocq
2fb1112066 Replace existing Time.zone.today.to_date for just Date.current 2018-01-17 00:45:30 +01:00
Bertocq
a2b950d8de Fix to_not to not_to on rspec expectations 2018-01-17 00:03:23 +01:00
BertoCQ
d44db9cec4 Merge branch 'master' into feature/budget_phases 2018-01-16 17:47:47 +01:00
Raimond Garcia
a215c9c603 Merge pull request #2322 from consul/current_budget
Change concept of current budget to account for multiple budgets
2018-01-16 16:53:10 +01:00
Bertocq
ca3d759d9f Refactor Budget publishing prices phases constant to Budget::Phase model 2018-01-16 12:18:13 +01:00
Bertocq
66691b644a Refactor Budget::PHASES constant to Budget::Phase::PHASE_KINDS 2018-01-16 12:18:13 +01:00
rgarcia
34e0c23bb3 Fix valuators authorization spec
This spec used to pass, because even though there were no budgets, as
Budget.current returned an array, it gracefully handled situations
without budgets

Now we assume that there can only be a single current budget, and so
calling any method of budget will raise an exception unless there is a
current budget present

Valuators should not access this page when there is no budget present,
however it might be wise to create an issue to cover this case, just in
case
2018-01-15 22:02:05 +01:00
rgarcia
5086314bee Display only current budget for Valuators
Before we could have multiple current budgets, as we now only have one
current_budget, some specs broke.

As there is no need to display multiple budgets to Valuators, only the
current budget is necessary, we can remove arrays and assume that only
a single budget, the current budget, is displayed to Valuators
2018-01-15 22:02:04 +01:00
rgarcia
01ef439053 Display only current budget to Managers printing investments
In the specs, some investment were missing a heading_id, thus creating
another unexpected budget

By explicitly setting the heading_id we can control better which
budgets are created in each test
2018-01-15 22:02:04 +01:00
BertoCQ
3d5bf04829 Merge pull request #2311 from consul/2299-budget_investments_related_content
Budget investments related content
2018-01-15 20:02:34 +01:00
BertoCQ
61f52b3483 Merge pull request #2293 from wairbut-m2c/aperez-fix-deprecation-warnings
Fix for test suite deprecations warnings
2018-01-15 18:23:42 +01:00
María Checa
b2054ac531 Improved relationable tests for budget investments 2018-01-12 18:26:37 +01:00