diff options
author | Matthew Somerville <matthew@mysociety.org> | 2011-06-06 19:01:35 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2011-06-06 19:01:35 +0100 |
commit | 1825445a2763a9581bedab749f9c60bf03648313 (patch) | |
tree | 2ecc99ffede2687bee54c4e9f659404f97c06c88 /t/app/controller/alert_new.t | |
parent | a201def5a054e06f612067879ca05351848f2b79 (diff) |
Fix alert subscribing bugs with two-tier councils and on ReportEmptyHomes.
Diffstat (limited to 't/app/controller/alert_new.t')
-rw-r--r-- | t/app/controller/alert_new.t | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/t/app/controller/alert_new.t b/t/app/controller/alert_new.t index ff1acd480..6fc32acbf 100644 --- a/t/app/controller/alert_new.t +++ b/t/app/controller/alert_new.t @@ -347,6 +347,33 @@ for my $test ( }; } +subtest "Test two-tier council alerts" => sub { + for my $alert ( + { feed => "local:51.896269:-2.093063", result => '/rss/l/51.896269,-2.093063' }, + { feed => "area:2326:Cheltenham", result => '/rss/area/Cheltenham' }, + { feed => "area:2326:4544:Cheltenham:Lansdown", result => '/rss/area/Cheltenham/Lansdown' }, + { feed => "area:2226:Gloucestershire", result => '/rss/area/Gloucestershire' }, + { feed => "area:2226:14949:Gloucestershire:Lansdown%2C_Park_and_Warden_Hill", + result => '/rss/area/Gloucestershire/Lansdown%2C+Park+and+Warden+Hill' + }, + { feed => "council:2326:Cheltenham", result => '/rss/reports/Cheltenham' }, + { feed => "ward:2326:4544:Cheltenham:Lansdown", result => '/rss/reports/Cheltenham/Lansdown' }, + { feed => "council:2226:Gloucestershire", result => '/rss/reports/Gloucestershire' }, + { feed => "ward:2226:14949:Gloucestershire:Lansdown%2C_Park_and_Warden_Hill", + result => '/rss/reports/Gloucestershire/Lansdown%2C+Park+and+Warden+Hill' + }, + ) { + $mech->get_ok( '/alert/list?pc=GL502PR' ); + $mech->submit_form_ok( { + button => 'rss', + with_fields => { + feed => $alert->{feed}, + } + } ); + is $mech->uri->path, $alert->{result}; + } +}; + subtest "Test normal alert signups and that alerts are sent" => sub { my $user1 = FixMyStreet::App->model('DB::User') ->find_or_create( { email => 'reporter@example.com', name => 'Reporter User' } ); |