Commit Graph

28 Commits

Author SHA1 Message Date
Javi Martín
b431273869 Simplify creating officer assignments in specs
Note we usually cannot make it simple because officer assignments are
usually assigned to both a poll and a booth, and on a certain date.
However, in the few cases where the booth nor the date don't matter, we
can make the code a bit easier to read.
2019-09-30 14:10:45 +02:00
Javi Martín
7b0771106e Remove isolated useless assignments
These variables are not surrounded by other assignments, and so they can
safely be removed without making it harder to read the code vertically.
2019-09-25 12:43:44 +02:00
Javi Martín
320b7550ed Simplify assigning poll to a booth in specs
We were creating booth assignments explicitely, but we can use the
`has_many :through` relationship to make the code easier to read.
2019-09-25 12:38:37 +02:00
Javi Martín
307cf24846 Use describe on feature tests
The `type: :feature` is automatically detected by RSpec because these
tests are inside the `spec/features` folder. Using `feature` re-adds a
`type: :feature` to these files, which will result in a conflict when we
upgrade to Rails 5.1's system tests.

Because of this change, we also need to change `background` to `before`
or else these tests will fail.
2019-05-28 16:36:54 +02:00
Bertocq
ba9346162c Improve officing result specs 2019-05-21 13:26:44 +02:00
decabeza
94b8caffca Merge branch 'master' into proposal-dashboard 2019-04-04 14:08:30 +02:00
Bertocq
71bd6e41c6 Replace time.zone.today for date.current 2019-03-28 15:49:17 +01:00
Bertocq
49ffcfac06 Move set officing booth helper method calls to background block 2019-03-28 15:47:52 +01:00
Bertocq
d2e8f84759 Create missing shift and choose booth for the officer 2019-03-28 15:47:52 +01:00
decabeza
eda6ea7f12 Merge branch 'master' into dashboard 2019-03-26 16:45:48 +01:00
Senén Rodero Rodríguez
c73aae9663 Remove before validation callback
This was breaking nested poll_questions_answers when submitting
more than one new answer at a time.
2019-03-21 14:51:17 +01:00
Julian Herrero
31ac8b7f55 Change single quotes to double quotes 2019-02-15 11:40:39 +01:00
decabeza
c8f49644ce Fixes english translations 2018-11-08 12:07:13 +01:00
Javi Martín
02b8bc6f69 Simplify the way to freeze time in specs 2018-09-19 14:10:18 +02:00
Javier Martín
de0afe1621 Don't monkey patch ActiveSupport.
It could have side effects (for example, a conflict after upgrading to
Rails 5).

Thanks @aitbw for the suggestion!
2018-07-09 00:06:55 +02:00
Javier Martín
4a559ed3cd Avoid date changes during results tests.
As explained by @iagirre with pinpoint accuracy [1]:

"If the officer_assignments are created at 23:59:59 and the rest of the
test is executed after 00:00:00, the dates for the objects and the
`Date.current` (used to check if there are any shifts today) won't be
the same, because the shift will be for, lets say, 07/03/2018 and
`Date.current` will be 08/03/2018, so, there are no shifts."

Freezing time avoids this issue.

Related to issues #2520 and #2521.

[1] https://github.com/AyuntamientoMadrid/consul/pull/1342
2018-07-09 00:06:55 +02:00
Bertocq
34bb9d65b1 Enable RSpec/NotToNot cop and fix all issues
Read about cop at http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/NotToNot
2018-01-07 17:39:48 +01:00
BertoCQ
c6d683083f Merge pull request #2073 from consul/feature/2072#remove_question_valid_answers
Remove valid answers usage
2017-10-18 11:52:14 +02:00
Bertocq
39f23d3b7b Switch from valid_answers to question_answers on specs 2017-10-18 01:28:38 +02:00
Bertocq
04910fea5b Remove officing results date picker for current date 2017-10-17 21:00:19 +02:00
Bertocq
b5cf28cb35 Swap Poll White/Null/Total usage for Poll Recount 2017-10-02 15:46:49 +02:00
Bertocq
9c6a974bec Fix wrong spectations after final result swap for total result 2017-09-19 18:54:37 +02:00
Bertocq
e8d748a881 Add Poll Total recount to officing and admin 2017-09-14 15:33:58 +02:00
Juanjo Bazán
58b1ad950a fix bug storing null results as white results 2017-02-18 12:11:49 +01:00
Juanjo Bazán
2a902c68eb adds creation of null and white results by poll officers 2017-02-03 19:11:04 +01:00
Juanjo Bazán
f060969422 adds changes logging to poll partial results 2017-02-02 16:26:21 +01:00
Juanjo Bazán
ec8d45f3cd adds index view for poll results in officing 2017-02-02 16:10:40 +01:00
Juanjo Bazán
592fdffe4e adds results creation by poll officers 2017-02-02 14:44:44 +01:00