diff options
-rw-r--r-- | t/app/controller/questionnaire.t | 49 | ||||
-rw-r--r-- | templates/web/default/questionnaire/index.html | 2 |
2 files changed, 50 insertions, 1 deletions
diff --git a/t/app/controller/questionnaire.t b/t/app/controller/questionnaire.t index af99a058e..ecb243709 100644 --- a/t/app/controller/questionnaire.t +++ b/t/app/controller/questionnaire.t @@ -255,6 +255,55 @@ foreach my $test ( }; } + +for my $test ( + { + state => 'confirmed', + fixed => 0 + }, + { + state => 'planned', + fixed => 0 + }, + { + state => 'in progress', + fixed => 0 + }, + { + state => 'investigating', + fixed => 0 + }, + { + state => 'closed', + fixed => 0 + }, + { + state => 'fixed', + fixed => 1 + }, + { + state => 'fixed - council', + fixed => 1 + }, + { + state => 'fixed - user', + fixed => 1 + }, +) { + subtest "correct fixed text for state $test->{state}" => sub { + $report->state ( $test->{state} ); + $report->update; + + $mech->get_ok("/Q/" . $token->token); + $mech->title_like( qr/Questionnaire/ ); + if ( $test->{fixed} ) { + $mech->content_contains('An update marked this problem as fixed'); + } else { + $mech->content_lacks('An update marked this problem as fixed'); + } + }; +} + # EHA extra checking ok $mech->host("reportemptyhomes.com"), 'change host to reportemptyhomes'; diff --git a/templates/web/default/questionnaire/index.html b/templates/web/default/questionnaire/index.html index d463ff2f9..a7e5ad60c 100644 --- a/templates/web/default/questionnaire/index.html +++ b/templates/web/default/questionnaire/index.html @@ -59,7 +59,7 @@ href="http://www.emptyhomes.com/getinvolved/campaign.html">http://www.emptyhomes [% END %] <p> -[% loc('An update marked this problem as fixed.') IF problem.state == 'fixed' %] +[% loc('An update marked this problem as fixed.') IF problem.is_fixed %] [% loc('Has this problem been fixed?') %] </p> |