diff options
author | Struan Donald <struan@exo.org.uk> | 2011-09-21 11:41:23 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2011-09-21 11:41:23 +0100 |
commit | d941a8c26e943c941f8e37ecbd9a9982dd41cb70 (patch) | |
tree | 75ea20fb18e984912ba60e4e499114c83cf431fe /t/app/controller/report_new.t | |
parent | 9da2d7b0e806407e3ed5e5418a53fca64757a39a (diff) | |
parent | 77f31e8c96c727ea5ab9cf217cfd924074e8f3ed (diff) |
Merge branch 'master' of ssh://git.mysociety.org/data/git/public/fixmystreet into js-validation
Conflicts:
templates/web/default/report/display.html
Diffstat (limited to 't/app/controller/report_new.t')
-rw-r--r-- | t/app/controller/report_new.t | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/t/app/controller/report_new.t b/t/app/controller/report_new.t index 807fc6e72..ff4f4294f 100644 --- a/t/app/controller/report_new.t +++ b/t/app/controller/report_new.t @@ -566,6 +566,7 @@ subtest "test report creation for a user who is signing in as they report" => su }; #### test report creation for user with account and logged in +my ($saved_lat, $saved_lon); foreach my $test ( { category => 'Trees', council => 2326 }, { category => 'Potholes', council => 2226 }, @@ -614,7 +615,7 @@ foreach my $test ( $mech->submit_form_ok( { with_fields => { - title => 'Test Report', + title => "Test Report at caf\xc3\xa9", detail => 'Test report details.', photo => '', name => 'Joe Bloggs', @@ -654,12 +655,26 @@ foreach my $test ( # user is still logged in $mech->logged_in_ok; + # Test that AJAX pages return the right data + $mech->get_ok( + '/ajax?bbox=' . ($report->longitude - 0.01) . ',' . ($report->latitude - 0.01) + . ',' . ($report->longitude + 0.01) . ',' . ($report->latitude + 0.01) + ); + $mech->content_contains( "Test Report at caf\xc3\xa9" ); + $saved_lat = $report->latitude; + $saved_lon = $report->longitude; + # cleanup $mech->delete_user($user); }; } +$contact2->category( "Pothol\xe9s" ); +$contact2->update; +$mech->get_ok( '/report/new/ajax?latitude=' . $saved_lat . '&longitude=' . $saved_lon ); +$mech->content_contains( "Pothol\xc3\xa9s" ); + #### test uploading an image #### test completing a partial report (eq flickr upload) |