diff options
Diffstat (limited to 't/cobrand')
-rw-r--r-- | t/cobrand/councils.t | 18 | ||||
-rw-r--r-- | t/cobrand/get_council_sender.t | 8 |
2 files changed, 22 insertions, 4 deletions
diff --git a/t/cobrand/councils.t b/t/cobrand/councils.t new file mode 100644 index 000000000..8fb10cfbe --- /dev/null +++ b/t/cobrand/councils.t @@ -0,0 +1,18 @@ +use strict; +use warnings; +use Test::More; + +use FixMyStreet::TestMech; +my $mech = FixMyStreet::TestMech->new; + +foreach my $council (qw/southampton reading bromley/) { + SKIP: { + skip( "Need '$council' in ALLOWED_COBRANDS config", 3 ) + unless FixMyStreet::Cobrand->exists($council); + ok $mech->host("$council.fixmystreet.com"), "change host to $council"; + $mech->get_ok('/'); + $mech->content_like( qr/$council/i ); + } +} + +done_testing(); 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; |