From e57cbf483790bedfef6496be3c7ffa42882c3ffc Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Tue, 13 Jun 2017 18:39:05 +0100 Subject: [UK] Remove requirement for fixed body IDs. Historically in UK cobrands, bodies have had IDs the same as the MapIt area ID they cover. This can be confusing (if you are setting up a dev environment, say) and should not be necessary. This commit removes the requirement entirely, by switching any ID checks to either the name of the body, or the actual area it covers. One note: the body name in the test has to match so that we do not get two bodies both covering 2237 created. This will not be necessary when the tests are compartmentalized in the next commit. --- t/app/controller/admin.t | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 't/app/controller/admin.t') diff --git a/t/app/controller/admin.t b/t/app/controller/admin.t index 48a5edc44..07759197e 100644 --- a/t/app/controller/admin.t +++ b/t/app/controller/admin.t @@ -8,7 +8,7 @@ my $user2 = $mech->create_user_ok('test2@example.com', name => 'Test User 2'); my $superuser = $mech->create_user_ok('superuser@example.com', name => 'Super User', is_superuser => 1); -my $oxfordshire = $mech->create_body_ok(2237, 'Oxfordshire County Council', id => 2237); +my $oxfordshire = $mech->create_body_ok(2237, 'Oxfordshire County Council'); my $oxfordshirecontact = $mech->create_contact_ok( body_id => $oxfordshire->id, category => 'Potholes', email => 'potholes@example.com' ); $mech->create_contact_ok( body_id => $oxfordshire->id, category => 'Traffic lights', email => 'lights@example.com' ); my $oxfordshireuser = $mech->create_user_ok('counciluser@example.com', name => 'Council User', from_body => $oxfordshire); @@ -16,7 +16,7 @@ my $oxfordshireuser = $mech->create_user_ok('counciluser@example.com', name => ' my $oxford = $mech->create_body_ok(2421, 'Oxford City Council'); $mech->create_contact_ok( body_id => $oxford->id, category => 'Graffiti', email => 'graffiti@example.net' ); -my $bromley = $mech->create_body_ok(2482, 'Bromley Council', id => 2482); +my $bromley = $mech->create_body_ok(2482, 'Bromley Council'); my $user3 = $mech->create_user_ok('test3@example.com', name => 'Test User 2'); @@ -115,7 +115,7 @@ subtest 'check summary counts' => sub { my ($num_alerts) = $mech->content =~ /(\d+) confirmed alerts/; my ($num_qs) = $mech->content =~ /(\d+) questionnaires sent/; - $report->bodies_str(2237); + $report->bodies_str($oxfordshire->id); $report->cobrand('oxfordshire'); $report->update; -- cgit v1.2.3