Commit Graph

20 Commits

Author SHA1 Message Date
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
da121ebc53 Remove redundant setting resets in after blocks
Settings are stored in the database, and so any changes to the settings
done during the tests are automatically rolled back between one test and
the next one.

There were also a few places where we weren't using an `after` block but
changing the setting at the end of the test.
2019-09-23 13:47:45 +02:00
taitus
230d1a4e9d Not display :year_of_birth when :date_of_birth is present 2019-07-29 13:10:09 +02:00
taitus
3e383d7c1f Add new fields to form
- Add :date_of_birth and :postal_code
- Only display new fields when aplication has configured the
custom census API and contains alias values for fields. Add 2
class Setting methods to check this feature:
  - force_presence_date_of_birth?
  - force_presence_postal_code?
2019-07-29 13:10:09 +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
71bd6e41c6 Replace time.zone.today for date.current 2019-03-28 15:49:17 +01:00
Bertocq
80a9ba8aa7 Enable and fix booth selection back 2019-03-28 15:47:52 +01:00
rgarcia
88c801d6c5 fixes specs 2019-03-28 15:47:52 +01:00
rgarcia
0acec655e2 fixes specs 2019-03-28 15:47:52 +01:00
rgarcia
74706027cb fixes specs 2019-03-28 15:47:52 +01:00
rgarcia
b4499321d3 stores officer booth on sign in 2019-03-28 15:47:52 +01:00
Julian Herrero
31ac8b7f55 Change single quotes to double quotes 2019-02-15 11:40:39 +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
735eab8e71 Avoid date changes during residence tests.
As it happened with results (commit 4a559ed), these tests failed if
`Date.current` changes between the moment records are created and the
moment the rest of the test is executed.
2018-07-09 00:17:15 +02:00
decabeza
16ff5c4400 Hides sidebar menus if officer has no shifts assigned 2018-07-04 17:22:03 +02:00
Vicente Mendoza
910d49d18c Focus the search of the button 2018-02-09 12:51:15 +01:00
kikito
8ca4cc22b0 Adds specs for creating failed officing census calls 2017-02-12 14:22:46 +01:00
Juanjo Bazán
b88de40ebe restricts access to residence validations to assigned officers 2017-02-03 10:43:03 +01:00
rgarcia
2bc4649aa7 uses year of birth instead of date of birth 2017-02-01 11:13:59 +01:00
rgarcia
6c34599e1e adds officer residence check and user voting 2017-01-29 00:36:20 +01:00