Commit Graph

17 Commits

Author SHA1 Message Date
Javi Martín
b787e33883 Use the same system to freeze time in all specs
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.
2018-09-19 14:11:50 +02:00
Bertocq
ce0a7f6fad Rubocop autocorrections 2017-10-17 22:00:00 +02:00
BertoCQ
6a0197a61b Merge branch 'master' into feature/1985#voting_token 2017-10-07 10:46:13 +02:00
Bertocq
bfef00d478 Refactor voted_before_sign_in logic to avoid no-answer scenario error 2017-10-06 20:07:57 +02:00
Bertocq
165509b525 Switch from Poll::Answer to Poll::Voter usage and small fixes 2017-10-06 18:59:47 +02:00
Bertocq
6994f6d7fe Remove random token generation, we'll use JS on the client when its empty 2017-10-06 15:28:25 +02:00
Bertocq
d4408efda6 Generate a unique token for a Poll Ballot and use it on answer buttons 2017-10-06 14:36:21 +02:00
María Checa
8e5cf50679 Prevent user from seeing its votes in a poll after signing in 2017-10-06 12:52:13 +02:00
María Checa
c3f778bbdd Check if user has voted before sign in 2017-10-06 01:18:56 +02:00
Bertocq
1c1bb7bf38 Remove no longer used functions 2017-09-19 01:12:24 +02:00
Bertocq
02524b164a Rubocop autocorrections (indentations, revers unless to if, extra spaces) 2017-06-08 12:14:35 +02:00
Juanjo Bazán
945020894d adds selected option via params for helper methods 2017-02-02 11:53:57 +01:00
Juanjo Bazán
72ac75abeb adds final recounting to poll officers' zone 2017-01-30 17:44:39 +01:00
Juanjo Bazán
05f054ece4 adds final recount/results shift for officers from Admin 2017-01-30 17:44:39 +01:00
Juanjo Bazán
8a77861165 adds helper for booth and date selectors 2016-12-27 17:46:24 +01:00
Juanjo Bazán
1a20a3ce46 refactors i18n for polls 2016-12-07 14:49:56 +01:00
rgarcia
20cb044015 adds search and filter for poll questions 2016-11-29 11:46:30 +01:00