Files
grecia/spec/factories
Javi Martín fd14c55615 Make answer depend on the option in poll answer factory
Until now, when writing `create(:poll_answer, option: option)`, the
`answer` field would take the title of a random option instead of taking
the title from the `option` variable.

So now, if we're given the option, the `answer` field will be taken from
the option itself.

Note that writing something like:

```
option { question.question_options.find_by(title: answer) }
answer { option.title }
```

Would create an infinite loop when creating a poll answer if we don't
pass the `option` and/or the `answer` attributes.

So, instead, we're making the `option` depend on the `answer` attribute
exclusively when we pass the `answer` attribute to the factory.
2025-08-14 12:58:51 +02:00
..
2024-01-25 18:30:28 +01:00
2024-03-25 07:59:42 +01:00