diff options
Diffstat (limited to 't/app/controller')
-rw-r--r-- | t/app/controller/questionnaire.t | 9 | ||||
-rw-r--r-- | t/app/controller/report_display.t | 24 |
2 files changed, 31 insertions, 2 deletions
diff --git a/t/app/controller/questionnaire.t b/t/app/controller/questionnaire.t index e56734bfc..af99a058e 100644 --- a/t/app/controller/questionnaire.t +++ b/t/app/controller/questionnaire.t @@ -204,7 +204,12 @@ foreach my $test ( } my $result; - $result = 'fixed' if $test->{fields}{been_fixed} eq 'Yes'; + $result = 'fixed - user' + if $test->{fields}{been_fixed} eq 'Yes' + && $test->{problem_state} ne 'fixed'; + $result = 'fixed' + if $test->{fields}{been_fixed} eq 'Yes' + && $test->{problem_state} eq 'fixed'; $result = 'confirmed' if $test->{fields}{been_fixed} eq 'No'; $result = 'unknown' if $test->{fields}{been_fixed} eq 'Unknown'; @@ -214,7 +219,7 @@ foreach my $test ( # Check the right HTML page has been returned $mech->content_like( qr/<title>[^<]*Questionnaire/m ); $mech->content_contains( 'glad to hear it’s been fixed' ) - if $result eq 'fixed'; + if $result =~ /fixed/; $mech->content_contains( 'get some more information about the status of your problem' ) if $result eq 'unknown'; $mech->content_contains( "sorry to hear that" ) diff --git a/t/app/controller/report_display.t b/t/app/controller/report_display.t index 1f857a387..5c66200c8 100644 --- a/t/app/controller/report_display.t +++ b/t/app/controller/report_display.t @@ -235,6 +235,30 @@ for my $test ( banner_text => 'This problem has been fixed.', fixed => 1 }, + { + description => 'user fixed report', + date => DateTime->now, + state => 'fixed - user', + banner_id => 'fixed', + banner_text => 'This problem has been fixed.', + fixed => 1 + }, + { + description => 'council fixed report', + date => DateTime->now, + state => 'fixed - council', + banner_id => 'fixed', + banner_text => 'This problem has been fixed.', + fixed => 1 + }, + { + description => 'closed report', + date => DateTime->now, + state => 'closed', + banner_id => '', + banner_text => '', + fixed => 0 + }, ) { subtest "banner for $test->{description}" => sub { $report->confirmed( $test->{date}->ymd . ' ' . $test->{date}->hms ); |