Why:
Sometimes the latitude or longitude it passed to the map as *********
instead of the actual latitude or longitud. The asterisks are not a
string, breaking the whole array
https://github.com/consul/consul/issues/2380
What:
This commits skips invalid markers and displays the rest
How:
- Substituting the mysterious asterisks for null
(cleanInvestmentCoordinates)
- Validating the coordinates are numbers before trying to pain
them(validCoordinates)
- Adding a numeric function to validate the latitude and longitude
(isNumeric)
https://stackoverflow.com/questions/9716468/is-there-any-function-like-i
snumeric-in-javascript-to-validate-numbers#answer-9716488
Add specs to check that the translations
are being deleted correctly and the
current locale tab is highlighted when the
admin visits the edit milestone page.
By using a random seed value smaller than 1, we solve the previous
situation[1] in a simpler way
This test is now obsolete.
It’s hard to write a tests to verify that even with a big seed in
params, we will covert it to a float smaller than 1.
We should refactor these `set_random_seed` methods into a nice model or
controller concern and test it thoroughly
[1]
https://github.com/AyuntamientoMadrid/consul/commit/ba3bf11526fc6ce9c66f
647c414946c61ff945fe
This is a defensive test, just in case we decide to go back to using
`setseed` instead of the `modulus`[1] approach to display investments
in random order
The reason for this test is that `setseed` only ~works in the next
`select` statement. And as when loading a user’s votes for investments
we do a second `select` it does not work as expected 😌
To solve this… we could call `set_random_seed` before loading a user’s
votes for an investment[2]
[1] https://github.com/consul/consul/pull/2131
[2]
https://github.com/AyuntamientoMadrid/consul/blob/master/app/controllers
/budgets/investments_controller.rb#L37
We are trying out a modulus function to return investments in random
order https://github.com/consul/consul/pull/2131
However we ran into the gotcha of having a seed value too big for the
modulus function to work as expected
If the seed is bigger than the investment id, the records are returned
ordered by id
By dividing the seed by a big number, this problem seems to get fixed
When there are no budgets we were seeing an exception in the budgets’
index
There are two parts to take into account here:
1) Making sure there is a current_budget present, otherwise we display
the “no budgets” message
2) The map helper is called from the controller, so we need to make
sure current_budget is present there too
Note: We could have added a bunch of `try` statements in the budgets’s
index, instead of using a conditional, however there are quite a few
`current_budget` calls so it seems more appropriate to use a conditional
The now-deprecated `.trigger('click')` API simulated a click against
the DOM rather a click on the UI, which made our tests fragile and
wouldn't simulate actual user interaction
Advanced search scenarios for Budget::Investments, Debates and
Proposals need proper date formatting as they behave unexpectedly
when APIs such as `7.days.ago` are used
JS modals/browser alerts are not automatically accepted now with
Selenium, events that trigger such events must be wrapped in one
of the following methods: `accept_alert`, `accept_confirm` or
`dismiss_confirm`
Now that we have the option of voting in multiple headings per group,
the method of voting in a “different heading assigned” has become
deprecated and thus removed
Milestones should be listed ordered by publication date instead of
creation date. The spec was creating only one milestone and not even
expecting the descriptions to be present in the page.