Commit Graph

32 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
12cdbf6196 Simplify assigning officer to a poll in specs
While it could be argued we're hiding the real way we've defined
associations in our models, the tests are so much easier to read when we
don't have so many lines just creating data.

Furthermore, developers who care about vertically aligning the code will
be glad to see some variables disrupting this alignment are now gone.
2019-09-25 12:38:37 +02:00
Javi Martín
4edab79910 Use yes_no trait to simplify creating answers
We lose some variety in our answers, though, but on the plus side, we
reduce the risk of trademark issues :P.
2019-09-24 21:34:06 +02:00
decabeza
08e820c134 Hide polls created by users on admin poll booth assigments 2019-09-11 18:44:32 +02:00
Javi Martín
e64289c5f9 Fix double quotes inside double quotes
The interpolation was being evaluated as a comment.
2019-08-27 17:22:22 +02:00
Javi Martín
0b55097820 Remove system count from old booth assigments
This number was not the important one; the important one is the one
given by the recounts.

Note we're also removing the votes by date, since they're also system
votes.
2019-08-07 20:31:45 +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
decabeza
51d74ed7ab Replace poll name link in admin polls booth assignments 2019-02-25 14:10:25 +01:00
Julian Herrero
31ac8b7f55 Change single quotes to double quotes 2019-02-15 11:40:39 +01:00
Angel Perez
122b17033b Use Selenium API to accept/dismiss JS modals/browser alerts
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`
2018-03-27 14:47:49 -04: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
c2b5083d4f Fix missing and extra spacing 2017-12-16 17:59:16 +01:00
iagirre
4819d1b74e Enabled one test disabled to run in local 2017-10-30 16:55:13 +01:00
iagirre
4b8a471d38 Specs added to test the functionality and some UI modified to make test pass 2017-10-30 16:50:25 +01:00
Bertocq
17e6a66b80 Refactor booth assigment management feature specs to test new assign/unassign feature 2017-10-19 22:33:00 +02:00
rgarcia
98f5d70e6d makes specs more robust 2017-10-19 11:28:09 +02:00
rgarcia
6a697bd6d0 adds specs 2017-10-19 11:28:09 +02:00
Bertocq
bf981ca828 Remove Booth Assignment officer totals and add final&system counts 2017-09-25 18:47:44 +02:00
Bertocq
f27fcc7f99 Replace FinalResult with TotalResult at admin BoothAssignment show 2017-09-19 00:45:13 +02:00
Bertocq
361e0efe00 Remove Poll Recount model and all usages 2017-07-23 23:29:24 +02:00
Bertocq
b79df113cd Switch all Time.curren.to_date for Date.current, same result but better syntax 2017-06-11 10:41:09 +02:00
Juanjo Bazán
01a52cc61a fixes ambiguous match error in specs 2017-01-31 19:09:58 +01:00
Juanjo Bazán
4ee50c86c0 adds final recounts info to admins 2017-01-30 20:42:30 +01:00
kikito
5d13bdc15d Removes 'manage' from admin permissions in Polls 2017-01-30 11:29:49 +01:00
Juanjo Bazán
cf6ca50a3b adds optional officer_assignment_id to poll::voters 2017-01-27 18:39:25 +01:00
Juanjo Bazán
e634e80113 adds system recounting to admin booth_assignments 2017-01-27 15:19:03 +01:00
Juanjo Bazán
0e9cec2ca6 adds spec for recount/officers lists in booth_assignment show 2017-01-05 13:00:48 +01:00
Juanjo Bazán
70b86170a2 adds booth_assignment show with officers and recounts info 2017-01-04 21:00:36 +01:00
Alberto Garcia Cabeza
4ab9a417fb updates specs 2016-12-28 14:04:28 +01:00
Juanjo Bazán
8b4f519d71 adds booth assignation to admin poll 2016-12-23 19:06:55 +01:00