diff options
author | Edmund von der Burg <evdb@mysociety.org> | 2011-02-09 18:05:04 +0000 |
---|---|---|
committer | Edmund von der Burg <evdb@mysociety.org> | 2011-02-09 18:05:04 +0000 |
commit | 170701f1942bc85a0f7cfeb18a675b7018c99873 (patch) | |
tree | f7c38e1e9cb8b8d15c6463db129e34570577947b | |
parent | 98a1f4400d0e8d2a24d2e23e54f7c467fd9ab586 (diff) |
Fix local alert tests
-rwxr-xr-x | bin/test-run | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/bin/test-run b/bin/test-run index eefc56c93..c2a02e82e 100755 --- a/bin/test-run +++ b/bin/test-run @@ -33,6 +33,7 @@ use Test::Harness; use File::Find; use lib "$FindBin::Bin/../perllib"; use Cobrand; +use FixMyStreet::Geocode; my @actions = ('report', 'update', 'questionnaire', 'alert', 'static', 'cobrand', 'unit', 'eha_alert', 'import', 'rss'); my %actions_desc = ( @@ -383,13 +384,21 @@ sub do_alert { # sign up for alerts in an area my $postcode = 'EH1 2NG'; - my $x = 2015; my $e = 325066; - my $y = 4175; my $n = 673533; + + my $x = 2015; + my $y = 4175; + + my $e = 325066; + my $n = 673533; + + # get the lat,lon from the postcode so that it matches + my ( $lat, $lon ) = FixMyStreet::Geocode::lookup( $postcode, undef ); + my $messages = english_fms_messages(); submit_postcode('', $postcode, 'Problems in this area'); $wth->browser_follow_link(text => 'Email me new local problems'); $wth->browser_submit_form(form_name => 'alerts', - fields => {feed => "local:" . $e . ":" . $n, + fields => {feed => "local:$lat:$lon", rznvy => email_n(2)} ); $wth->browser_check_contents('Nearly Done!'); my $confirmation_email = $wth->email_get_containing( @@ -402,7 +411,7 @@ sub do_alert { $wth->browser_check_contents('successfully confirmed your alert'); # create and confirm a new problem in the area - submit_report($postcode, $x, $y, 325000, 673387.096774193, 3, undef, $messages, ''); + submit_report($postcode, $x, $y, $e, $n, 3, undef, $messages, ''); # run the alert script call_send_emails(); |