aboutsummaryrefslogtreecommitdiffstats
path: root/t/app/controller/admin.t
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2012-12-14 23:13:53 +0000
committerMatthew Somerville <matthew@mysociety.org>2012-12-19 14:43:26 +0000
commitc9f99c84d02856f742e8e99cc88cd5edd22313c3 (patch)
tree96fd7e235615d71493931f2bcab0549801569711 /t/app/controller/admin.t
parent0fbacbf4108c2bbaff80a03fc45a6186c524fc9f (diff)
Area IDs come in as an arrayref, and body may not have an area ID.
Diffstat (limited to 't/app/controller/admin.t')
-rw-r--r--t/app/controller/admin.t12
1 files changed, 2 insertions, 10 deletions
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';