diff options
Diffstat (limited to 't/app/controller/admin/bodies.t')
-rw-r--r-- | t/app/controller/admin/bodies.t | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/t/app/controller/admin/bodies.t b/t/app/controller/admin/bodies.t index 75f0f606f..cd86e3da6 100644 --- a/t/app/controller/admin/bodies.t +++ b/t/app/controller/admin/bodies.t @@ -51,7 +51,7 @@ subtest 'check contact creation' => sub { non_public => 'on', } } ); $mech->get_ok('/admin/body/' . $body->id . '/test/category'); - $mech->content_contains('<h1>test/category</h1>'); + $mech->content_contains('test/category'); }; subtest 'check contact editing' => sub { @@ -91,6 +91,21 @@ subtest 'check contact editing' => sub { $mech->content_contains( '<td><strong>test2@example.com' ); }; +subtest 'check contact renaming' => sub { + my ($report) = $mech->create_problems_for_body(1, $body->id, 'Title', { category => 'test category' }); + $mech->get_ok('/admin/body/' . $body->id .'/test%20category'); + $mech->submit_form_ok( { with_fields => { category => 'private category' } } ); + $mech->content_contains('You cannot rename'); + $mech->submit_form_ok( { with_fields => { category => 'testing category' } } ); + $mech->content_contains( 'testing category' ); + $mech->get('/admin/body/' . $body->id . '/test%20category'); + is $mech->res->code, 404; + $mech->get_ok('/admin/body/' . $body->id . '/testing%20category'); + $report->discard_changes; + is $report->category, 'testing category'; + $mech->submit_form_ok( { with_fields => { category => 'test category' } } ); +}; + subtest 'check contact updating' => sub { $mech->get_ok('/admin/body/' . $body->id . '/test%20category'); $mech->content_like(qr{test2\@example.com</strong>[^<]*</td>[^<]*<td>unconfirmed}s); |