Commit Graph

2188 Commits

Author SHA1 Message Date
Raimond Garcia
e23fbc8d58 Merge pull request #2970 from PierreMesure/Remove-icon-png-from-settings
Removed icon_home and fixed corresponding test
2018-11-27 11:11:51 +01:00
Raimond Garcia
181918330c Merge pull request #3029 from clairezed/patch-1
Update debates_spec.rb
2018-11-27 11:09:15 +01:00
Raimond Garcia
1b7a2adf56 Merge pull request #3034 from behraaang/bugfix/pagination-after-select
Fix pagination after selecting/unselecting budget investment
2018-11-27 11:04:41 +01:00
Raimond Garcia
2ef83619c3 Merge pull request #3048 from jaflutz/2930-draft-phase-processes
Adds draft phase functionality in legislation processes
2018-11-27 11:01:27 +01:00
decabeza
6d7c5f1b78 Refactors admin administrators spec
This refactoring avoids "Use let instead of an instance variable" rubocop warning
2018-11-22 11:41:59 +01:00
decabeza
ae3a2ed3f3 Adds administrator id on admin administrators index page 2018-11-22 11:41:54 +01:00
João Lutz
34b58a5208 Adds draft phase functionality in legislation processes 2018-11-19 22:18:50 -02:00
behraaang
88f01fb999 fix spec 2018-11-16 01:12:14 +03:30
behraaang
7a9888a793 Fix failed spec, add pagination spec for unselecting an investemnt 2018-11-15 23:30:08 +03:30
decabeza
9284453e69 Adds spec when no message is displayed 2018-11-14 13:56:22 +01:00
Javier Martín
40224fed39 Merge pull request #3008 from consul/backport-1194-fix_flaky_valuators_specs
Fix flaky spec: Admin budget investment mark/unmark visible to valuators
2018-11-14 13:34:45 +01:00
decabeza
5abeeb8588 Fixes date format on legislation helper 2018-11-14 12:41:22 +01:00
Raimond Garcia
6cfd0c2e13 Merge pull request #3030 from consul/fix-poll-results-accuracy
Fix poll results accuracy
2018-11-13 14:03:49 +01:00
Alberto
56a2978b87 Merge pull request #3033 from consul/budgets-unselected-message
[Backport] Budgets unselected message
2018-11-12 18:22:54 +01:00
decabeza
dfa7148406 Shows unselected message only on balloting or later phase 2018-11-12 17:23:58 +01:00
decabeza
13b3d9cebc Fixes admin menu link when create a new widget 2018-11-12 17:11:17 +01:00
Juanjo Bazán
d8df2c1fa8 adds proper accuracy to spec 2018-11-11 14:54:58 +01:00
Claire Zuliani
3b5319508c Update debates_spec.rb
If I trust https://github.com/consul/consul/blob/master/db/seeds.rb#L85, debates recommendations Setting title is `recommendations_on_debates`, and not `recommendations_for_debates`.
2018-11-10 13:48:53 +01:00
Alberto
c25eb694bc Merge pull request #3023 from consul/budget-executions
[Backport] Budget executions
2018-11-08 13:01:27 +01:00
decabeza
c8f49644ce Fixes english translations 2018-11-08 12:07:13 +01:00
decabeza
0c5ac8cba6 Removes custom path on budgets executions specs 2018-11-08 11:59:29 +01:00
decabeza
1d5335c782 Display last milestones image
Also adds a second order to ensure the order to display milestones with same publication date is always the same
2018-11-07 18:25:02 +01:00
decabeza
ba1a6b4cc8 Display first image available for milestones 2018-11-07 18:09:23 +01:00
voodoorai2000
5856af03a5 Fix exception when no available milestones
We were getting an exception when quering[1] for milestones which were not present, due to for example having a publication date later than today

Adding a `try` statement and spec to avoid this situation

[1] 82efc3dd66/app/controllers/budgets/executions_controller.rb (L16)
2018-11-07 18:08:10 +01:00
Javier Martín
bad750a896 Merge pull request #2864 from consul/backport_1543-budget_execution_list
Budget execution list
2018-11-07 15:44:57 +01:00
Javi Martín
579ea8ab43 Make capybara wait between valuation actions
As mentioned in the comments in PR #1256:

"These failures take place because the checkbox is already present
before clicking in 'under valuation', and so Capybara doesn't have to
wait for the 'under valuation' request to finish before clicking the
checkbox."

So sometimes Capybara tries to check/uncheck the checkbox at the same
time that checkbox is being replaced by the new content, resulting in no
request being sent to the server.

Making Capybara check the page to ensure the new content is already
loaded before checking/unchecking the checkbox solves the problem.
2018-11-06 19:04:50 +01:00
decabeza
c049be6dae Improves message when there are no budgets 2018-11-06 18:11:13 +01:00
Javi Martín
b2e15facce Remove duplicated valuators specs
Since one of them was slightly different, I've kept the most recent one.
2018-11-06 17:23:22 +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
b6fdf732f2 Add total Investments in the execution list 2018-11-06 13:02:35 +01:00
María Checa
d089cc14a5 Add logic to handle budget investments with an execution process 2018-11-06 13:02:35 +01:00
Marko Lovic
406bbb4cdb Avoid unnecessary navigation for faster specs 2018-11-06 13:02:35 +01:00
Marko Lovic
375fbf775f Order non-city headings by alphabetical order 2018-11-06 13:02:35 +01:00
Marko Lovic
4758c1b91a Show city heading in first position on executions list 2018-11-06 13:02:35 +01:00
Marko Lovic
8376efce3f Hide headings with no investments
The page should not show any headings which don't have any
winning investments. The "no content" message should only be
shown when there are no headings with investments to avoid an
otherwise blank page.

__Note:__ in the main @headings query, _both_ #includes and #joins
are needed to:
 1. eager load all necessary data (#includes)
and
 2. to perform an INNER JOIN on milestones to filter out investments
with no milestones (#joins).
2018-11-06 13:02:35 +01:00
Angel Perez
a3ef662509 Filtering investments are based on the latest milestone status 2018-11-06 13:02:35 +01:00
Angel Perez
749954267d Use Budget::Investment#winners scope to fetch only winner investments 2018-11-06 13:02:34 +01:00
Angel Perez
62b99f01bc Show message for headings without winner investments 2018-11-06 13:02:34 +01:00
Angel Perez
5114792941 Add specs for budgets/executions feature 2018-11-06 13:02:34 +01:00
Alberto
d1e40adcbc Merge pull request #2994 from consul/social-meta-tags
[Backport] Social meta tags
2018-10-31 15:01:19 +01:00
decabeza
884580206a Fixes houndci-bot warnings 2018-10-31 14:22:10 +01:00
Javier Martín
d78b1c1998 Merge pull request #2995 from consul/backport-1618-fix_flaky_draft_versions_spec
Fix flaky spec: Admin legislation draft versions Update Valid legislation draft version
2018-10-31 13:12:17 +01:00
Javi Martín
5345b563e9 Don't check already present page content
The content 'An example legislation process' is already present before
we click the "All" link.

Not checking the page content properly sometimes resulted in the second
click being executed before the first request had been completed, making
the spec fail.

By checking the "All" link isn't present anymore, we guarantee the
request has been completed before trying to click the 'An example
legislation process' link.
2018-10-31 12:34:47 +01:00
decabeza
cd7bff04b4 Refactors social meta tags spec 2018-10-31 11:51:44 +01:00
voodoorai2000
7d5b57aee2 Add counter of emails sent to newsletter preview 2018-10-30 17:07:31 +01:00
Javi Martín
74927f4ed6 Make Capybara check the page between comment votes
As pointed out in PR consul#2734:

"After clicking the first link, there's an AJAX request which replaces
the existing `.in-favor a` and `.against a` links with new elements. So
if Capybara tries to click the existing `.against a` link at the same
moment it's being replaced, clicking the link won't generate a new
request".

Making Capybara check the page for new content before clicking the
second link solves the problem.

This commit solves issues afecting both Madrid's fork and the original
CONSUL repo.
2018-10-29 11:15:03 +01:00
Javi Martín
f5bb3c64a1 Don't run specs if there are custom fallbacks
This spec depends on French falling back to Spanish and was failing on
forks using a different fallback.
2018-10-22 16:36:18 +02:00
Javi Martín
2e6644d513 Fix crash with no translation for default locale
When we were visiting a page showing the content of a record which uses
globalize and our locale was the default one and there was no
translation for the default locale, the application was crashing in some
places because there are no fallbacks for the default locale.

For example, when visiting a legislation process, the line with
`CGI.escape(title)` was crashing because `title` was `nil` for the
default locale.

We've decided to solve this issue by using any available translations as
globalize fallbacks instead of showing a 404 error or a translation
missing error because these solutions would (we thinkg) either require
modifying many places in the application or making the translatable
logic even more complex.

Initially we tried to add this solution to an initializer, but it must
be called after initializing the application so I18n.fallbacks[locale]
gets the value defined in config.i18n.fallbacks.

Also note the line:

fallbacks[locale] = I18n.fallbacks[locale] + I18n.available_locales

Doesn't mention `I18n.default_locale` because the method
`I18n.fallbacks[locale]` automatically adds the default locale.
2018-10-22 16:36:18 +02:00
Javi Martín
dbea577062 Follow naming conventions for HTML classes and IDs
We use underscores for IDs and hyphens for classes.
2018-10-22 16:36:18 +02:00
Javi Martín
f1ccdb87b1 Fix removing an option for legislation questions
We were allowing the `_destroy` field for translations, but not for the
options themselves.
2018-10-22 16:36:17 +02:00