We were expecting translation parameters in legislation processes
`update` action. However, those parameters aren't sent when we get to
that action through the "proposals" tab.
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.
It was failing when executed right before midnight due to the date
changing between the moment the notification is created and the moment
the test checks the notification shows the current date.
Most factories were using dynamic times and dates since commit 0cf799a.
However:
* At the time, commits AyuntamientoMadrid/consul@71f5351 and
AyuntamientoMadrid/consul@a476a30 (which introduced static times/dates
in factories) hadn't been backported.
* The changes in commit 0cf799a overlooked the factory
`proposal_notification`.
This required changing the `voted_before_sign_in` slightly in order to
change what the method returns if the user signed in and voted at the
exact same microsecond.
It doesn't affect production code because it would be impossible for the
user to do both things at the same time.
As a side effect, the method now returns what the method name suggests.
Before this change, the correct method name would have been
`voted_before_or_at_the_same_time_of_sign_in`.
As a less desirable side effect, in the tests now we need to make sure
at least one second passes between the moment a user votes and the
moment a user signs in again. One microsecond wouldn't work because
the method `travel_to` automatically sets microseconds to zero in order
to avoid rounding issues.
In Madrid, the button text didn't change depending on whether the form
is for the "new" page or for the "edit" page.
In consul, the buttons texts were "create admin notification" and
"update admin notification" instead of "create notification" and "update
notification".
Also change translation key from "submit" to "submit_button" to
match other instances.
Using `have_content` detected textareas, but not text input contents.
All credit to Marko (mlovic) for finding the issue and suggesting the
implemented solution.
By doing so and including it in ActionDispatch::Routing::UrlFor, we make
it available in controllers, helpers and specs, and so we can remove the
duplication we had there with methods dealing with the same problem.
Even if monkey-patching is ugly, using a different module and executing
ActionDispatch::Routing::UrlFor.send(:include, MyModule) wouldn't make
the method available in the controller.
Dashboard routes have been refactored. Now instead of having resources
for dashboard and routes inside a dashboard namespace the proposal
routes contain a dashboar singleton containing everything related to it.
FIxed issue in last commit: supports controller were not correctly
filling the holes without data.
Fixed duplication in supports and successful supports controller using a
concer.
Successfull supports controller will fill the holes without data in the
same way that supports controller does.
Supports controller now fill the holes in the results: When there are no
supports collected for one interval it takes the accumulated value from the
previous one.
Data starts in the publication date.
* Fixed common ability: Retired draft proposal can't be published.
* Fixed proposal dashboard view: progress graph is not available for
draft proposals.
It fails because we try to follow a link without a Portuguese
translation. In Madrid they use Spanish as fallback, but in consul we
use English as fallback, and so the text in the link is different in
those repos.
A proper solution would be to update the Portuguese locales. However,
since this test is going to be removed in our next backport, I'm just
doing a quick patch.
In the past there have been issues with the `pt-BR` locale because
it has a hyphen `-` and a uppercase letters.
I am adding the test only to spec/features/translations_spec.rb (which
tests Milestones) for now. We might want to also add it to the other
translatable resource specs in the future (banners, etc.).
This method allows to fill in CONSUL's signup form without interacting
with other UI elements, useful when using testing locales other than English
Backported from Decide Madrid