diff options
author | Struan Donald <struan@exo.org.uk> | 2018-09-25 12:14:45 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2018-10-02 10:01:10 +0100 |
commit | af81846ae820d3f35d8009ca249891d51bb4eb13 (patch) | |
tree | b370343f4155032d52ff392bd544d7370a07c401 /perllib | |
parent | b927252ea84d8552f4ad7a7cf12accd1d49a9ead (diff) |
Adapt fixture script to be non-random on request.
The existing fixture script generates random results so is no use for
front end testing.
Diffstat (limited to 'perllib')
-rw-r--r-- | perllib/FixMyStreet/DB/Factories.pm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/DB/Factories.pm b/perllib/FixMyStreet/DB/Factories.pm index 56cff280b..db80773e7 100644 --- a/perllib/FixMyStreet/DB/Factories.pm +++ b/perllib/FixMyStreet/DB/Factories.pm @@ -171,8 +171,8 @@ sub create_problem { $params->{latitude} += rand(2 * $inaccurate_km) - $inaccurate_km; $params->{longitude} += rand(3 * $inaccurate_km) - 1.5 * $inaccurate_km, - $params->{title} = $titles->[$rand]; - $params->{detail} = $descs->[$rand]; + $params->{title} ||= $titles->[$rand]; + $params->{detail} ||= $descs->[$rand]; $params->{photo_id} = $photo; $params->{confirmed} = DateTime::Format::Pg->format_datetime($params->{confirmed}); return $self->create($params); |