Commit Graph

25 Commits

Author SHA1 Message Date
Bertocq
633cc1283b Fix Date & DateTime parsings to use default timezone
Date.new(...) does not take into account the current timezone, while other
parts of the application do. By default always parsing any date with the
default timezone and converting the resulting Time to Date would prevent
this kind of issues

DateTime.parse(...).in_time_zone gives an unexpected result, as the
DateTime.parse(...) will create a DateTime with +0000 time zone and the
`in_time_zone` will modify the DateTime to adjust to the default zone.

Maybe its better explained with an example, using 'Lima' as timezone:

DateTime.parse("2015-01-01")
> Thu, 01 Jan 2015 00:00:00 +0000

DateTime.parse("2015-01-01").in_time_zone
> Wed, 31 Dec 2014 19:00:00 -05 -05:00

And that's not the desired date but the previous day!
2018-04-04 14:21:39 +02:00
Bertocq
9e4559e374 Revert random district code on census api mock response 2018-01-23 18:38:07 +01:00
Bertocq
c30c47cbb5 Improve default city map with 4 districts, and more real fake geozones 2018-01-23 15:59:24 +01:00
María Checa
20fd8c0515 Officing tests improvements 2017-10-17 20:41:48 +02:00
Bertocq
c2d154b1ac Comply with Style/PredicateName rule for ? method names 2017-09-20 16:12:28 +02:00
Bertocq
69f4e1c683 Fix all rubocop Metrics/LineLength issues (140+) 2017-07-10 13:22:49 +02:00
rgarcia
d80303395b extracts census document parser to a module 2017-05-04 03:39:38 +02:00
rgarcia
b54aee5702 displays voter name if already voted 2016-11-14 13:52:38 +01:00
rgarcia
44df91346a validates voter in census 2016-11-14 13:51:59 +01:00
kikito
edb56b24ce removes lying comment 2016-04-13 14:30:58 +02:00
kikito
1b1f2bc2c9 renames genre to gender in code 2016-04-13 14:27:27 +02:00
kikito
4f724ef3bf Modifies census_api to parse genre and dob 2016-04-12 18:18:25 +02:00
kikito
6229097032 Fixes typo 2016-04-12 13:38:01 +02:00
kikito
9cc831bbc1 adds genre to the census api response 2016-04-11 18:41:33 +02:00
kikito
bcf41c786a Adds district code to census_api 2016-02-19 18:29:14 +01:00
kikito
5e1fba288c refactors method in census_api.rb 2015-12-22 11:49:38 +01:00
kikito
d8e6584bfe fixes comments 2015-12-21 17:10:07 +01:00
kikito
57e72206d2 makes the census api try several variants before failing a verification 2015-12-21 17:07:48 +01:00
kikito
cc1a69c7a5 fixes error in census_api and refactors constructor 2015-09-30 10:56:57 +02:00
kikito
1c372328d9 Refactor in residence verification + census api
Needed for a new census api verification using only the document type
(no date of birth and no postal code)
2015-09-29 20:18:52 +02:00
rgarcia
fbb5db8062 removes unnecessary address from users 2015-09-26 13:45:37 +02:00
rgarcia
abfc93ea78 hot fix to take into account preproduction 2015-09-02 11:36:30 +02:00
rgarcia
0df72b9260 updates census api keys 2015-09-01 20:05:35 +02:00
rgarcia
b9333c7bbe adds hotfix for invalid census api response 2015-08-28 16:43:14 +02:00
kikito
ffad7fbc86 Rename UserApi to CensusApi. Fixes #271 2015-08-28 15:38:22 +02:00