aboutsummaryrefslogtreecommitdiffstats
path: root/t/app/controller/admin
diff options
context:
space:
mode:
Diffstat (limited to 't/app/controller/admin')
-rw-r--r--t/app/controller/admin/bodies.t17
-rw-r--r--t/app/controller/admin/translations.t2
2 files changed, 17 insertions, 2 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);
diff --git a/t/app/controller/admin/translations.t b/t/app/controller/admin/translations.t
index f5c32baa6..442be68d5 100644
--- a/t/app/controller/admin/translations.t
+++ b/t/app/controller/admin/translations.t
@@ -59,7 +59,7 @@ subtest 'check add category with translation' => sub {
$mech->submit_form_ok( { with_fields => {
category => 'Potholes',
translation_de => 'DE potholes',
- email => 'potholes@example.org',
+ email => 'potholes',
} } );
# check that error page includes translations