diff options
author | Matthew Somerville <matthew@mysociety.org> | 2012-02-06 17:46:35 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2012-02-06 17:46:35 +0000 |
commit | fc8eb87bc798d411a80fc34b38c799610742d61b (patch) | |
tree | 608f30834c64d6e342f9da972b7af92f6626103f /t/cobrand | |
parent | 37b617efc532a71af9e0d0eb72c674a065fb9505 (diff) |
Improve cobrand mapping with ALLOWED_COBRANDS for #215.
Diffstat (limited to 't/cobrand')
-rw-r--r-- | t/cobrand/loading.t | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/t/cobrand/loading.t b/t/cobrand/loading.t index 405ef4761..bd83da07f 100644 --- a/t/cobrand/loading.t +++ b/t/cobrand/loading.t @@ -14,16 +14,14 @@ use_ok 'FixMyStreet::Cobrand'; ok $allowed, "got the allowed_cobrands"; isa_ok $allowed, "ARRAY"; cmp_ok scalar @$allowed, '>', 1, "got more than one"; - is join( '|', @$allowed ), FixMyStreet->config('ALLOWED_COBRANDS'), - "matches config value"; } # fake the allowed cobrands for testing my $override = Sub::Override->new( # - 'FixMyStreet::Cobrand::get_allowed_cobrands' => + 'FixMyStreet::Cobrand::_get_allowed_cobrands' => sub { return ['emptyhomes'] } ); -is_deeply FixMyStreet::Cobrand->get_allowed_cobrands, ['emptyhomes'], +is_deeply FixMyStreet::Cobrand->get_allowed_cobrands, [ { moniker => 'emptyhomes', host => 'emptyhomes' } ], 'overidden get_allowed_cobrands'; sub run_host_tests { @@ -45,7 +43,7 @@ run_host_tests( # now enable barnet too and check that it works $override->replace( # - 'FixMyStreet::Cobrand::get_allowed_cobrands' => + 'FixMyStreet::Cobrand::_get_allowed_cobrands' => sub { return [ 'emptyhomes', 'barnet' ] } ); |