From c9f99c84d02856f742e8e99cc88cd5edd22313c3 Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Fri, 14 Dec 2012 23:13:53 +0000 Subject: Area IDs come in as an arrayref, and body may not have an area ID. --- t/app/controller/admin.t | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 't/app/controller') diff --git a/t/app/controller/admin.t b/t/app/controller/admin.t index d8b721ca9..fecc5b10f 100644 --- a/t/app/controller/admin.t +++ b/t/app/controller/admin.t @@ -258,11 +258,7 @@ subtest 'check open311 configuring' => sub { $mech->content_contains('Council contacts configured via Open311'); $mech->content_contains('Configuration updated - contacts will be generated automatically later'); - my $open311 = - FixMyStreet::App->model('DB::Body')->search( { 'body_areas.area_id' => 2650 }, { join => 'body_areas' } ); - - is $open311->count, 1, 'only one configuration'; - my $conf = $open311->first; + my $conf = FixMyStreet::App->model('DB::Body')->find( 2650 ); is $conf->endpoint, 'http://example.com/open311', 'endpoint configured'; is $conf->api_key, 'api key', 'api key configured'; is $conf->jurisdiction, 'mySociety', 'jurisdiction configures'; @@ -282,11 +278,7 @@ subtest 'check open311 configuring' => sub { $mech->content_contains('Configuration updated'); - $open311 = - FixMyStreet::App->model('DB::Body')->search( { 'body_areas.area_id' => 2650 }, { join => 'body_areas' } ); - - is $open311->count, 1, 'only one configuration'; - $conf = $open311->first; + $conf = FixMyStreet::App->model('DB::Body')->find( 2650 ); is $conf->endpoint, 'http://example.org/open311', 'endpoint updated'; is $conf->api_key, 'new api key', 'api key updated'; is $conf->jurisdiction, 'open311', 'jurisdiction configures'; -- cgit v1.2.3