Commit Graph

18 Commits

Author SHA1 Message Date
German Galia
85722eb7c4 Rename admin/debates and admin/comments to hidden 2019-06-02 19:12:26 +02:00
Javi Martín
20b1085dc8 Simplify budget stats data generation
Configuring associations in the factories makes it easier to generate
headings, polls and ballots in the tests.
2019-05-21 13:50:17 +02:00
María Checa
e3b16230e6 Added slug to polls for named urls 2019-05-16 23:40:50 +02:00
decabeza
cb22e6cbfb Merge branch 'master' into proposal-dashboard 2019-04-23 17:12:47 +02:00
rgarcia
aeb84108bc Verify poll ballots 2019-04-10 18:29:01 +02:00
María Checa
394177213c Adds Ballot Sheet model and business logic 2019-04-10 16:04:39 +02: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
Javi Martín
b3a8924fe0 Don't create an officer for poll voter factories
For web poll voters, it isn't necessary in order to make the record
valid, and it adds an extra record to the database for each poll
voter created.
2019-03-19 13:29:45 +01:00
Javi Martín
4a3115607a Simplify poll stats test
Adding the option to assign a poll to a poll recount factory meant we
didn't need to create so much data.

Also note we're removing the `create(:poll_voter, origin: "booth")`
code, since it isn't used in the stats calculations.
2019-03-19 13:24:24 +01:00
Javi Martín
4830b563ea Create only one poll for a poll voter
The factories were creating strange database relations:

* The voter belonged to a poll, to a booth and to an officer
* The booth belonged to a different poll
* The officer belonged to a different booth

The code uses an unusual syntax because the following code:

association :booth_assignment,
            factory: :poll_booth_assignment,
            poll: poll

Would generate the following error:

ActiveRecord::AssociationTypeMismatch: Poll(#46976420451940) expected,
got FactoryBot::Declaration::Implicit
2019-03-19 13:19:24 +01:00
Javi Martín
b05ea2964c Simplify poll voter factory associations 2019-03-19 13:19:24 +01:00
Julian Herrero
9f9b1ed100 Assign officer assignment when creating voter from booth
If `officer_assigment' is not set the model cannot be validated,
because it cannot be blank.
2019-03-15 09:58:16 +01:00
Julian Herrero
92979b84b5 Set correct origin for booth poll votes 2019-03-15 09:55:12 +01:00
Julian Herrero
884274c4ad Add a description for open polls 2019-02-18 13:34:07 +01:00
Julian Herrero
31ac8b7f55 Change single quotes to double quotes 2019-02-15 11:40:39 +01:00
decabeza
bc1679550b Remove incoming polls filter 2019-02-08 14:28:19 +01:00
Pierre Mesure
cba6cc029e Split factories 2018-08-08 07:20:47 +02:00