We set `I18n.locale = :en` before each test, and so creating a new card
will automatically create English translations.
So visiting the Spanish page won't show the card, since no Spanish
translation exists for it. If we visit the klingon page after doing so,
the last used locale (Spanish) will still be used, and so the test will
fail.
Specifically creating Spanish translations instead of the English ones
makes the translations visible when visiting the Spanish homepage.
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.
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.
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.
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.).
If we ignore all params that are blank, there is no way to
"remove" an attribute (i.e. change its value to blank)
On the other hand, we don't want to create new translations
where all fields are empty, so the new code keeps only the
blank fields which belong to existing translations.