aboutsummaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to 't')
-rw-r--r--t/app/controller/moderate.t15
1 files changed, 14 insertions, 1 deletions
diff --git a/t/app/controller/moderate.t b/t/app/controller/moderate.t
index 00de29dd1..69408d600 100644
--- a/t/app/controller/moderate.t
+++ b/t/app/controller/moderate.t
@@ -346,7 +346,6 @@ subtest 'updates' => sub {
$mech->base_like( qr{\Q$REPORT_URL\E} );
$update->discard_changes;
- $update->discard_changes;
is $update->text, 'update good good bad good',
};
@@ -371,6 +370,20 @@ subtest 'updates' => sub {
$mech->content_lacks('Posted anonymously');
};
+ subtest 'Moderate extra data' => sub {
+ $update->set_extra_metadata('moon', 'waxing full');
+ $update->update;
+ my ($csrf) = $mech->content =~ /meta content="([^"]*)" name="csrf-token"/;
+ $mech->post_ok('http://www.example.org/moderate/report/' . $report->id . '/update/' . $update->id, {
+ %update_prepopulated,
+ 'extra.weather' => 'snow',
+ 'extra.moon' => 'waxing full',
+ token => $csrf,
+ });
+ $update->discard_changes;
+ is $update->get_extra_metadata('weather'), 'snow';
+ };
+
subtest 'Hide photo' => sub {
$report->update({ photo => undef }); # hide the main photo so we can just look for text in comment