diff options
Diffstat (limited to 't')
-rw-r--r-- | t/app/controller/report_display.t | 13 | ||||
-rw-r--r-- | t/app/controller/reports.t | 8 |
2 files changed, 17 insertions, 4 deletions
diff --git a/t/app/controller/report_display.t b/t/app/controller/report_display.t index 17b9180c1..2fc4fde9f 100644 --- a/t/app/controller/report_display.t +++ b/t/app/controller/report_display.t @@ -129,6 +129,7 @@ subtest "test a good report" => sub { 'Reported by Test User at 15:47, Sat 16 April 2011', 'correct problem meta information'; $mech->content_contains('Test 2 Detail'); + $mech->content_lacks('Sent to'); my $update_form = $mech->form_name('updateForm'); @@ -142,6 +143,18 @@ subtest "test a good report" => sub { is $update_form->value($_), $fields{$_}, "$_ value" for keys %fields; }; +subtest "test duration string" => sub { + $report->update({ whensent => \'current_timestamp' }); + $mech->get_ok("/report/$report_id"); + $mech->content_contains('Sent to Westminster'); + FixMyStreet::override_config { + AREA_LINKS_FROM_PROBLEMS => 1, + }, sub { + $mech->get_ok("/report/$report_id"); + $mech->content_contains('Sent to <a href="http://localhost/reports/Westminster+City+Council">Westminster'); + }; +}; + foreach my $meta ( { anonymous => 'f', diff --git a/t/app/controller/reports.t b/t/app/controller/reports.t index c57b15a8e..3c18b1383 100644 --- a/t/app/controller/reports.t +++ b/t/app/controller/reports.t @@ -1,7 +1,7 @@ use Test::MockTime qw(:all); use FixMyStreet::TestMech; use mySociety::MaPit; -use FixMyStreet::App; +use FixMyStreet::DB; use FixMyStreet::Script::UpdateAllReports; use DateTime; @@ -254,7 +254,7 @@ subtest "it lists shortlisted reports" => sub { FixMyStreet::override_config { MAPIT_URL => 'http://mapit.uk/' }, sub { - my $body = FixMyStreet::App->model('DB::Body')->find( $body_edin_id ); + my $body = FixMyStreet::DB->resultset('Body')->find( $body_edin_id ); my $user = $mech->log_in_ok( 'test@example.com' ); $user->update({ from_body => $body }); $user->user_body_permissions->find_or_create({ @@ -304,7 +304,7 @@ subtest "it allows body users to filter by subtypes" => sub { FixMyStreet::override_config { MAPIT_URL => 'http://mapit.uk/' }, sub { - my $body = FixMyStreet::App->model('DB::Body')->find( $body_edin_id ); + my $body = FixMyStreet::DB->resultset('Body')->find( $body_edin_id ); my $user = $mech->log_in_ok( 'test@example.com' ); $user->update({ from_body => $body }); @@ -363,7 +363,7 @@ subtest "it does not allow body users to filter subcategories for other bodies" FixMyStreet::override_config { MAPIT_URL => 'http://mapit.uk/' }, sub { - my $body = FixMyStreet::App->model('DB::Body')->find( $body_west_id ); + my $body = FixMyStreet::DB->resultset('Body')->find( $body_west_id ); my $user = $mech->log_in_ok( 'test@example.com' ); $user->update({ from_body => $body }); |