diff options
Diffstat (limited to 't/app/controller/questionnaire.t')
-rw-r--r-- | t/app/controller/questionnaire.t | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/t/app/controller/questionnaire.t b/t/app/controller/questionnaire.t index 3475307fb..3a6a3d6ad 100644 --- a/t/app/controller/questionnaire.t +++ b/t/app/controller/questionnaire.t @@ -190,6 +190,25 @@ foreach my $test ( # update => 'Dummy', Error for not setting this tested below }, }, + { + desc => 'Closed report, said fixed, reported before, no update, no further questionnaire', + problem_state => 'closed', + fields => { + been_fixed => 'Yes', + reported => 'Yes', + another => 'No', + }, + }, + { + desc => 'Closed report, said not fixed, reported before, no update, no further questionnaire', + problem_state => 'closed', + fields => { + been_fixed => 'No', + reported => 'Yes', + another => 'No', + }, + lastupdate_static => 1, + }, ) { subtest $test->{desc} => sub { $report->state ( $test->{problem_state} ); @@ -224,7 +243,8 @@ foreach my $test ( $result = 'fixed' if $test->{fields}{been_fixed} eq 'Yes' && $test->{problem_state} eq 'fixed'; - $result = 'confirmed' if $test->{fields}{been_fixed} eq 'No'; + $result = 'confirmed' if $test->{fields}{been_fixed} eq 'No' && $test->{problem_state} ne 'closed'; + $result = 'closed' if $test->{fields}{been_fixed} eq 'No' && $test->{problem_state} eq 'closed'; $result = 'unknown' if $test->{fields}{been_fixed} eq 'Unknown'; my $another = 0; @@ -234,10 +254,12 @@ foreach my $test ( $mech->content_like( qr/<title>[^<]*Questionnaire/m ); $mech->content_contains( 'glad to hear it’s been fixed' ) if $result =~ /fixed/; + $mech->content_lacks( 'glad to hear it’s been 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" ) - if $result eq 'confirmed'; + if $result eq 'confirmed' || $result eq 'closed'; # Check the database has the right information $report->discard_changes; |