aboutsummaryrefslogtreecommitdiffstats
path: root/perllib
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2018-09-25 12:14:45 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2018-10-02 10:01:10 +0100
commitaf81846ae820d3f35d8009ca249891d51bb4eb13 (patch)
treeb370343f4155032d52ff392bd544d7370a07c401 /perllib
parentb927252ea84d8552f4ad7a7cf12accd1d49a9ead (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.pm4
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);