aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/TestMech.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2012-12-14 19:07:08 +0000
committerMatthew Somerville <matthew@mysociety.org>2012-12-19 14:43:26 +0000
commitddf9dbdbf6486c781ca4a5822614b0b7cee2c062 (patch)
tree09c12affc3390138b03292d3f90810287b4941d0 /perllib/FixMyStreet/TestMech.pm
parentda29e8a75eaa92e98807ad89d29d3d1f3c01bc14 (diff)
Allow bodies to span multiple area IDs, and areas can be covered by more than one body.
Diffstat (limited to 'perllib/FixMyStreet/TestMech.pm')
-rw-r--r--perllib/FixMyStreet/TestMech.pm9
1 files changed, 8 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/TestMech.pm b/perllib/FixMyStreet/TestMech.pm
index cc4e45f45..addbb1752 100644
--- a/perllib/FixMyStreet/TestMech.pm
+++ b/perllib/FixMyStreet/TestMech.pm
@@ -536,11 +536,18 @@ sub create_body_ok {
my $self = shift;
my ( $id, $name ) = @_;
- my $params = { id => $id, area_id => $id, name => $name };
+ my $params = { id => $id, name => $name };
my $body = FixMyStreet::App->model('DB::Body')->find_or_create($params);
$body->update($params); # Make sure
ok $body, "found/created user for $id $name";
+
+ FixMyStreet::App->model('DB::BodyArea')->find_or_create({
+ area_id => $id,
+ body_id => $id,
+ });
+
return $body;
+
}
sub create_problems_for_body {