diff options
Diffstat (limited to 't/app')
-rw-r--r-- | t/app/controller/develop.t | 45 | ||||
-rw-r--r-- | t/app/controller/moderate.t | 20 |
2 files changed, 47 insertions, 18 deletions
diff --git a/t/app/controller/develop.t b/t/app/controller/develop.t index 92aa86721..8f26a9f16 100644 --- a/t/app/controller/develop.t +++ b/t/app/controller/develop.t @@ -6,14 +6,20 @@ my ($problem) = $mech->create_problems_for_body(1, 2504, 'title'); my $update = $mech->create_comment_for_problem($problem, $problem->user, 'Name', 'Text', 'f', 'confirmed', 'confirmed'); subtest 'not visible on live site' => sub { - FixMyStreet::override_config { - STAGING_SITE => 0 - }, sub { - $mech->get('/_dev/email/'); - is $mech->res->code, 404; - $mech->get('/_dev/email/login'); - is $mech->res->code, 404; - }; + $mech->get('/_dev/'); + is $mech->res->code, 404; + $mech->get('/_dev/email'); + is $mech->res->code, 404; + $mech->get('/_dev/email/login'); + is $mech->res->code, 404; +}; + +$problem->user->update({ is_superuser => 1 }); +$mech->log_in_ok($problem->user->email); + +subtest 'dev index' => sub { + $mech->get_ok('/_dev/'); + $mech->content_contains('<h1>/_dev</h1>'); }; subtest 'dev email index page' => sub { @@ -30,4 +36,27 @@ subtest 'individual email previews' => sub { $mech->get_ok('/_dev/email/update-confirm?update=' . $update->id); }; +subtest 'problem confirmation page preview' => sub { + $mech->get_ok('/_dev/confirm_problem/' . $problem->id ); +}; + +subtest 'update confirmation page preview' => sub { + $mech->get_ok('/_dev/confirm_update/' . $problem->id); +}; + +subtest 'alert confirmation page preview' => sub { + $mech->get_ok('/_dev/confirm_alert/subscribe'); +}; + +subtest 'contact form submission page preview' => sub { + $mech->get_ok('/_dev/contact_submit/1'); +}; + +subtest 'questionnaire completion page previews' => sub { + $mech->get_ok('/_dev/questionnaire_completed?been_fixed=Yes'); + $mech->get_ok('/_dev/questionnaire_completed?been_fixed=Unknown'); + $mech->get_ok('/_dev/questionnaire_completed?new_state=confirmed'); + $mech->get_ok('/_dev/questionnaire_creator_fixed'); +}; + done_testing(); diff --git a/t/app/controller/moderate.t b/t/app/controller/moderate.t index 4b2f0cfe3..c2ac3ad5a 100644 --- a/t/app/controller/moderate.t +++ b/t/app/controller/moderate.t @@ -86,7 +86,7 @@ subtest 'Auth' => sub { my %problem_prepopulated = ( problem_show_name => 1, - problem_show_photo => 1, + problem_photo => 1, problem_title => 'Good bad good', problem_detail => 'Good bad bad bad good bad', ); @@ -146,7 +146,7 @@ subtest 'Problem moderation' => sub { $mech->submit_form_ok({ with_fields => { %problem_prepopulated, - problem_show_photo => 0, + problem_photo => 0, }}); $mech->base_like( qr{\Q$REPORT_URL\E} ); @@ -154,7 +154,7 @@ subtest 'Problem moderation' => sub { $mech->submit_form_ok({ with_fields => { %problem_prepopulated, - problem_show_photo => 1, + problem_photo => 1, }}); $mech->base_like( qr{\Q$REPORT_URL\E} ); @@ -251,8 +251,8 @@ sub create_update { } my %update_prepopulated = ( update_show_name => 1, - update_show_photo => 1, - update_detail => 'update good good bad good', + update_photo => 1, + update_text => 'update good good bad good', ); my $update = create_update(); @@ -263,7 +263,7 @@ subtest 'updates' => sub { $mech->get_ok($REPORT_URL); $mech->submit_form_ok({ with_fields => { %update_prepopulated, - update_detail => 'update good good good', + update_text => 'update good good good', }}) or die $mech->content; $mech->base_like( qr{\Q$REPORT_URL\E} ); @@ -274,7 +274,7 @@ subtest 'updates' => sub { subtest 'Revert text' => sub { $mech->submit_form_ok({ with_fields => { %update_prepopulated, - update_revert_detail => 1, + update_revert_text => 1, }}); $mech->base_like( qr{\Q$REPORT_URL\E} ); @@ -314,7 +314,7 @@ subtest 'updates' => sub { $mech->submit_form_ok({ with_fields => { %update_prepopulated, - update_show_photo => 0, + update_photo => 0, }}); $mech->base_like( qr{\Q$REPORT_URL\E} ); @@ -322,7 +322,7 @@ subtest 'updates' => sub { $mech->submit_form_ok({ with_fields => { %update_prepopulated, - update_show_photo => 1, + update_photo => 1, }}); $mech->base_like( qr{\Q$REPORT_URL\E} ); @@ -348,7 +348,7 @@ subtest 'Update 2' => sub { $mech->get_ok($REPORT_URL); $mech->submit_form_ok({ with_fields => { %update_prepopulated, - update_detail => 'update good good good', + update_text => 'update good good good', }}) or die $mech->content; $update2->discard_changes; |