diff options
author | Hakim Cassimally <hakim@mysociety.org> | 2014-10-10 11:58:54 +0000 |
---|---|---|
committer | Hakim Cassimally <hakim@mysociety.org> | 2014-10-10 13:15:57 +0000 |
commit | 7b6bab7b6ea82f5ef8afc541b4a19abb48f3f0b2 (patch) | |
tree | 8ead232f7bec9a64c43e0db427c93a90aaa62e5e /t/cobrand | |
parent | 3c9b7f15dc9ac9231ab88c0242d37704a8bfca52 (diff) |
UK. Generic problems_clause for two-tier councils
Replace copy-pasted problems_cause declarations in Hart,
Oxfordshire, and East Sussex with a generic override in
UKCouncils.pm (as a bonus also overrides Stevenage)
Diffstat (limited to 't/cobrand')
-rw-r--r-- | t/cobrand/two_tier.t | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/t/cobrand/two_tier.t b/t/cobrand/two_tier.t new file mode 100644 index 000000000..288da643f --- /dev/null +++ b/t/cobrand/two_tier.t @@ -0,0 +1,28 @@ +use strict; +use warnings; +use Test::More; + +use FixMyStreet; +use FixMyStreet::Cobrand; + +my @cobrands = ( + [ hart => '%2333%' ], + [ oxfordshire => '%2237%' ], + [ eastsussex => '%2224%' ], + [ stevenage => '%2347%' ], +); + +FixMyStreet::override_config { + ALLOWED_COBRANDS => [ map $_->[0], @cobrands ], +}, sub { + + for my $c (@cobrands) { + my ($m, $like) = @$c; + my $cobrand = FixMyStreet::Cobrand->get_class_for_moniker($m); + my $problems_clause = $cobrand->problems_clause; + is_deeply $problems_clause, + { bodies_str => { like => $like } }, "problems_clause for $m"; + } +}; + +done_testing; |