diff --git a/t/app/controller/report_display.t b/t/app/controller/report_display.t index 00c7bf19ba6..63e91fa19b6 100644 --- a/t/app/controller/report_display.t +++ b/t/app/controller/report_display.t @@ -198,6 +198,8 @@ foreach my $meta ( }; } +my $old_date = DateTime->new( year => 2009, month => 6, day => 12, hour => 9, minute => 43, second => 12 ); + for my $test ( { description => 'new report', @@ -209,14 +211,7 @@ for my $test ( }, { description => 'old report', - date => DateTime->new( - year => 2009, - month => 6, - day => 12, - hour => 9, - minute => 43, - second => 12 - ), + date => $old_date, state => 'confirmed', banner_id => 'unknown', banner_text => 'unknown', @@ -225,31 +220,27 @@ for my $test ( { cobrand => 'fixmystreet', description => 'old open311 report', - date => DateTime->new( - year => 2009, - month => 6, - day => 12, - hour => 9, - minute => 43, - second => 12 - ), + date => $old_date, state => 'confirmed', send_method => 'Open311', banner_id => undef, banner_text => undef, fixed => 0 }, + { + cobrand => 'fixmystreet', + description => 'scheduled report', + date => $old_date, + state => 'action scheduled', + send_method => 'Open311', + banner_id => 'progress', + banner_text => 'Action scheduled', + fixed => 0 + }, { cobrand => 'westminster', description => 'old westminster report', - date => DateTime->new( - year => 2009, - month => 6, - day => 12, - hour => 9, - minute => 43, - second => 12 - ), + date => $old_date, state => 'confirmed', banner_id => undef, banner_text => undef, @@ -257,14 +248,7 @@ for my $test ( }, { description => 'old fixed report', - date => DateTime->new( - year => 2009, - month => 6, - day => 12, - hour => 9, - minute => 43, - second => 12 - ), + date => $old_date, state => 'fixed', banner_id => 'fixed', banner_text => 'fixed', @@ -389,13 +373,13 @@ for my $test ( } if ( $test->{banner_id} ) { - ok $banner->{class} =~ /banner--$test->{banner_id}/i, 'banner class'; + like $banner->{class}, qr/banner--$test->{banner_id}/i, 'banner class'; } else { is $banner->{class}, $test->{banner_id}, 'banner class'; } if ($test->{banner_text}) { - ok $banner->{text} =~ /$test->{banner_text}/i, 'banner text'; + like $banner->{text}, qr/$test->{banner_text}/i, 'banner text'; } else { is $banner->{text}, $test->{banner_text}, 'banner text'; } diff --git a/templates/web/fixmystreet-uk-councils/report/banner.html b/templates/web/fixmystreet-uk-councils/report/banner.html index 6c917e7acb4..013490842d5 100644 --- a/templates/web/fixmystreet-uk-councils/report/banner.html +++ b/templates/web/fixmystreet-uk-councils/report/banner.html @@ -18,5 +18,5 @@ [% END %] [% IF problem.is_in_progress %] - [% INCLUDE banner, id = 'progress', text = loc('In progress') %] + [% INCLUDE banner, id = 'progress', text = prettify_state(problem.state) %] [% END %] diff --git a/templates/web/fixmystreet.com/report/banner.html b/templates/web/fixmystreet.com/report/banner.html index 47db6f1b0d3..5eeabe2ac76 100644 --- a/templates/web/fixmystreet.com/report/banner.html +++ b/templates/web/fixmystreet.com/report/banner.html @@ -22,7 +22,7 @@ [% IF problem.send_method_used != 'Open311' AND problem.is_open AND date.now - problem.lastupdate.epoch > 8 * 7 * 24 * 60 * 60 %] [% INCLUDE banner, id = 'unknown', text = loc('Status unknown') %] [% ELSIF problem.is_in_progress %] - [% INCLUDE banner, id = 'progress', text = loc('In progress') %] + [% INCLUDE banner, id = 'progress', text = prettify_state(problem.state) %] [% END %] [% END %]