Commit Graph

43 Commits

Author SHA1 Message Date
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
Julian Herrero
31ac8b7f55 Change single quotes to double quotes 2019-02-15 11:40:39 +01:00
decabeza
e7eade2b33 Add spec to legislatiorn processses with past filter
This filter was removed from admin view but keep existing on front views.
2019-02-11 17:28:18 +01:00
decabeza
060a4c684f Remove legislation processes next filter 2019-02-08 14:29:43 +01:00
Julian Nicolas Herrero
81b65ec821 Merge pull request #3202 from consul/sort_legislation_processes_by_start_date
Sort Legislation Processes by descending start date
2019-01-29 17:30:02 +01:00
Javi Martín
b552f6e70b Add heading to milestones progress bars 2019-01-24 17:33:43 +01:00
Javi Martín
e73f3bd97a Add progress bars to milestones public view 2019-01-24 17:33:34 +01:00
Julian Herrero
33d6f6c18d Sort Legislation Processes by descending start date 2019-01-22 18:51:22 +01:00
decabeza
9dfbeed140 Moves draft and final result publication dates from tabs to sidebar 2019-01-15 16:13:41 +01:00
decabeza
73637de0d0 Adds homepage phase and tab to legislation processes show 2019-01-15 16:13:38 +01:00
Alberto
bbcb96027b Merge pull request #3137 from consul/key-dates-processes
[Backport] Processes key dates
2019-01-08 10:51:40 +01:00
decabeza
dd8e2d6311 Shows participation phases only if there is a phase enabled 2018-12-28 18:23:08 +01:00
decabeza
a8fb479be5 Adds specs for show view has document present on all phases 2018-12-28 17:22:08 +01:00
Raimond Garcia
d583c93ebf Merge pull request #3118 from consul/rubocop-not-to
Apply Rubocop not_to rule
2018-12-19 12:47:37 +01:00
Raimond Garcia
ea435ac56c Merge pull request #3112 from consul/rubocop_not_to
Add not_to Rubocop rule
2018-12-19 11:29:44 +01:00
voodoorai2000
b8cc7c5389 Apply rubocop not_to rule 2018-12-19 11:23:53 +01:00
dperez
bef404c443 add homepage for legislation processes 2018-12-15 18:04:24 +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
b95ca9df8a Add milestones to legislation process view 2018-12-11 20:18:53 +01:00
Javi Martín
a769c61c02 Add frozen time condition to proposals phase spec
Backport the part of AyuntamientoMadrid@ea6fcb5 which hadn't been
backported yet.
2018-12-07 15:09:07 +01:00
João Lutz
34b58a5208 Adds draft phase functionality in legislation processes 2018-11-19 22:18:50 -02:00
decabeza
5abeeb8588 Fixes date format on legislation helper 2018-11-14 12:41:22 +01: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
ec18743251 Authorize resource after authenticating user
Just like it's done everywhere else in the application. Not doing so
means users who aren't logged in receive a "you aren't authorized"
message when they try to create a new legislation proposal instead of
being redirected to the login page.
2018-10-03 22:06:20 +02:00
María Checa
388c1a9bd9 Improved tests 2018-10-03 16:02:41 +02:00
María Checa
d73be15296 Added tests 2018-10-03 16:02:41 +02:00
Javi Martín
86aa56b5e8 Fix flaky legislation processes specs
They were failing if executed right before midnight. If the process is
created right before midnight and then the date changes, when we visit
the process path the phase will aready be open.
2018-09-19 14:24:09 +02:00
decabeza
b93543cbf9 Shows message only if there is questions on legislation debate 2018-04-27 18:24:53 +02:00
decabeza
f2e5f6ff76 Adds specs for additional info button 2018-03-07 17:18:55 +01:00
Bertocq
4f6597b200 Enable RSpec/RepeatedDescription cop & fix all issues
Read about cop at http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RepeatedDescription
2018-01-07 17:45:34 +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
Bertocq
fa017b664f Enables RSpec/EmptyLineAfterFinalLet cop & fixes all issues
Read about cop at http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/EmptyLineAfterFinalLet
2018-01-07 00:49:37 +01:00
Manuel Ortega
b8a45eda58 Added legislation process documents
New test to ensure document is shown in process show
2017-10-19 12:10:54 +02:00
Eduardo Martinez Echevarria
0bc318c823 Add tests to check visibility of processes depending on published attribute 2017-06-30 15:08:23 +02:00
Eduardo Martinez Echevarria
3e5c5d7e49 Define some actions on legislation processes as member actions 2017-06-30 15:08:23 +02:00
Bertocq
e55328caf4 Rename legislation process final_version_publication phase name to more descriptive result_publication 2017-06-13 22:04:36 +02:00
Bertocq
0c27f1ffde Rename Legislation Process final_publication_date field to more descriptive result_publication_date 2017-06-13 22:04:36 +02:00
Fernando Blat
0c5063add9 Show message when there aren't processes 2017-01-05 09:36:08 +01:00
Amaia Castro
2b6df62dd7 Refactor process phases pages 2017-01-04 14:02:25 +01:00
Amaia Castro
368430d914 Legislation Question page 2016-12-22 16:00:28 +01:00
Amaia Castro
959b36caa8 Add more specs for process page (phases) 2016-12-22 13:21:44 +01:00
Amaia Castro
36399277ec Legislation Process page 2016-12-22 11:23:49 +01:00
Amaia Castro
a4055a1578 Legislation processes home page 2016-12-16 17:59:44 +01:00