diff options
author | Struan Donald <struan@exo.org.uk> | 2011-05-25 16:43:28 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2011-05-25 16:43:28 +0100 |
commit | 6a679dbe9f0d7021f176ca23106a74bc2475539e (patch) | |
tree | 731af77d81f4855c045faadd3726fadbb1bb0c18 /t/app/controller | |
parent | 34296c409fe2ab9f02e5aeb14100570a8fb68dea (diff) |
submission for questionnaire when problem owner marks it fixed
Diffstat (limited to 't/app/controller')
-rw-r--r-- | t/app/controller/report_updates.t | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/t/app/controller/report_updates.t b/t/app/controller/report_updates.t index f921b9ebb..1836423ba 100644 --- a/t/app/controller/report_updates.t +++ b/t/app/controller/report_updates.t @@ -498,10 +498,6 @@ for my $test ( is $mech->uri->path, "/report/" . $report_id, "redirected to report page"; - if ( $mech->uri->path eq '/report/update' ) { - print $mech->content; - } - is $mech->extract_problem_banner->{text}, $test->{endstate_banner}, 'submitted banner'; $mech->email_count_is(0); @@ -639,6 +635,27 @@ foreach my $test ( is $update->state, 'confirmed', 'update confirmed'; is $update->anonymous, $test->{anonymous}, 'user anonymous'; + SKIP: { + skip( 'not answering questionnaire', 5 ) if $questionnaire; + + $mech->submit_form_ok( ); + + my @errors = @{ $mech->page_errors }; + ok scalar @errors, 'displayed error messages'; + is $errors[0], "Please say whether you've ever reported a problem to your council before", 'error message'; + + $mech->submit_form_ok( { with_fields => { reported => 'Yes' } } ); + + $mech->content_contains( 'Thank you — you can' ); + + $questionnaire = FixMyStreet::App->model( 'DB::Questionnaire' )->find( + { problem_id => $report_id } + ); + + ok $questionnaire, 'questionnaire exists'; + ok $questionnaire->ever_reported, 'ever reported is yes'; + }; + if ($questionnaire) { $questionnaire->delete; ok !$questionnaire->in_storage, 'questionnaire deleted'; |