Our Docker image uses Chromium v57, which is not supported by
chromedriver versions after 2.38. See
https://bugs.chromium.org/p/chromedriver/issues/detail?id=2445
The reason that the version of chromium is so old is that our base
image ruby:2.3.6 (the standard image for Ruby 2.3.6 on DockerHub) is
built on Debian 8 (jessie), which was made obsolete over a year ago.
The best solution is probably to upgrade the application to Ruby 2.3.7
(if not later), so we can use the official ruby:2.3.7 image, which is
kept up-to-date (it has Chromium 68).
Alternatively, we could try to install Chromium from a more up-to-date
repository, but this is probably not worth the trouble.
I've moved the method to the User model in order to make it easier to
test. I'm not sure where it belongs, though.
There was already a failing spec in `spec/features/management_spec.rb`,
but it passed if run standalone because it only failed if previous tests
had already created nine users or more.
When visiting http://localhost:3000/admin/site_customization/information_texts?locale=fr
and creating a translation, other languages where storing translations in db with
the following values:
"<span class=\"translation_missing\" title=\"translation missing: es.debates.index.search_results.one\">One</span>">
With this commit we are not storing this translations
Note that this only happened when using a param[:locale] in the url at least for french
After creating a translation in spanish, it was also displaying it when selecting
the english locale.
This was due to the code picking the first translation available
With this commit, we are checking for an existing translation in the current locale
and displaying it if it exists
When visiting, for example, /admin/site_customization/information_texts?locale=fr
we were getting an `UncaughtThrowError: uncaught throw :exception`
With the following payload
```
File "/aytomad/app/participa/participacion/releases/20180726231929/app/views/admin/site_customization/information_texts/_form_field.html.erb" line 5
File "/aytomad/app/participa/participacion/releases/20180726231929/app/helpers/globalize_helper.rb" line 35 in block in globalize
```
Substituting this line seems to solve it
Note that we had to remove the portuguese local too, as it was giving a different
exception due to this change. This problem, has been solved in the original
globalization PR