diff options
author | Struan Donald <struan@exo.org.uk> | 2012-09-28 12:57:01 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2012-09-28 12:57:01 +0100 |
commit | e31037e1ee3f2b4ca5bcc4238bbe22cbb4a71760 (patch) | |
tree | fa824369e7f616eaaf06b02cf34e0452e8ea07c5 | |
parent | 5d094d3a3a9114acc7f53e89ace7e9640654b7c3 (diff) |
we now return a hash from get_council_sender
-rw-r--r-- | perllib/FixMyStreet/Cobrand/UK.pm | 6 | ||||
-rw-r--r-- | t/cobrand/get_council_sender.t | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/perllib/FixMyStreet/Cobrand/UK.pm b/perllib/FixMyStreet/Cobrand/UK.pm index f0f3e85f6..feb3c9ecf 100644 --- a/perllib/FixMyStreet/Cobrand/UK.pm +++ b/perllib/FixMyStreet/Cobrand/UK.pm @@ -33,9 +33,9 @@ sub disambiguate_location { sub _fallback_council_sender { my ( $self, $area_id, $area_info, $category ) = @_; - return 'London' if $area_info->{type} eq 'LBO'; - return 'NI' if $area_info->{type} eq 'LGD'; - return 'Email'; + return { method => 'London' } if $area_info->{type} eq 'LBO'; + return { method => 'NI' } if $area_info->{type} eq 'LGD'; + return { method => 'Email' }; } sub process_extras { diff --git a/t/cobrand/get_council_sender.t b/t/cobrand/get_council_sender.t index 9004a47f5..e61f36370 100644 --- a/t/cobrand/get_council_sender.t +++ b/t/cobrand/get_council_sender.t @@ -13,8 +13,8 @@ mySociety::Locale::gettext_domain( 'FixMyStreet' ); my $c = FixMyStreet::Cobrand::FixMyStreet->new(); -is $c->get_council_sender( '1000', { type => 'DIS' } ), 'Email', 'defaults to email'; -is $c->get_council_sender( '1000', { type => 'LBO' } ), 'London', 'returns london report it if London borough'; +is_deeply $c->get_council_sender( '1000', { type => 'DIS' } ), { method => 'Email' }, 'defaults to email'; +is_deeply $c->get_council_sender( '1000', { type => 'LBO' } ), { method=> 'London' }, 'returns london report it if London borough'; my $conf = FixMyStreet::App->model('DB::Open311Conf')->find_or_create( area_id => 1000, @@ -22,8 +22,8 @@ my $conf = FixMyStreet::App->model('DB::Open311Conf')->find_or_create( send_method => 'TestMethod' ); -is $c->get_council_sender( '1000', { type => 'LBO' } ), 'TestMethod', 'uses send_method in preference to London'; -is $c->get_council_sender( '1000', { type => 'DIS' } ), 'TestMethod', 'uses send_method in preference to Email'; +is $c->get_council_sender( '1000', { type => 'LBO' } )->{ method }, 'TestMethod', 'uses send_method in preference to London'; +is $c->get_council_sender( '1000', { type => 'DIS' } )->{ method }, 'TestMethod', 'uses send_method in preference to Email'; $conf->delete; |