aboutsummaryrefslogtreecommitdiffstats
path: root/t/app/controller
diff options
context:
space:
mode:
authorDave Whiteland <dave@mysociety.org>2012-10-03 17:57:29 +0100
committerDave Whiteland <dave@mysociety.org>2012-10-03 17:57:29 +0100
commitfae33181698a051204c933a42c4587e985f2d984 (patch)
tree0049569fd0fd0d42a2137e59f79e8384450cbc37 /t/app/controller
parent272dba7ce6d59d81b52579dd4c5fc7d65e9bec20 (diff)
parent5b3824c84f0ade0d8ac9258eb30379f8d7e11023 (diff)
Merge branch 'master' of ssh://git.mysociety.org/data/git/public/fixmystreet
Diffstat (limited to 't/app/controller')
-rw-r--r--t/app/controller/questionnaire.t26
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&rsquo;s been fixed' )
if $result =~ /fixed/;
+ $mech->content_lacks( 'glad to hear it&rsquo;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;