aboutsummaryrefslogtreecommitdiffstats
path: root/t/app/controller/report_updates.t
diff options
context:
space:
mode:
Diffstat (limited to 't/app/controller/report_updates.t')
-rw-r--r--t/app/controller/report_updates.t33
1 files changed, 21 insertions, 12 deletions
diff --git a/t/app/controller/report_updates.t b/t/app/controller/report_updates.t
index 07ee48587..e8ab1cc85 100644
--- a/t/app/controller/report_updates.t
+++ b/t/app/controller/report_updates.t
@@ -22,6 +22,8 @@ my $user2 = $mech->create_user_ok('commenter@example.com', name => 'Commenter');
my $body = $mech->create_body_ok(2504, 'Westminster City Council');
+my $contact = $mech->create_contact_ok( body_id => $body->id, category => 'Other', email => 'other' );
+
my $dt = DateTime->new(
year => 2011,
month => 04,
@@ -1893,6 +1895,18 @@ for my $test (
};
}
+$mech->log_in_ok( $report->user->email );
+
+my %standard_fields = (
+ name => $report->user->name,
+ update => 'update text',
+ photo1 => '',
+ photo2 => '',
+ photo3 => '',
+ may_show_name => 1,
+ add_alert => 1,
+);
+
for my $test (
{
desc => 'update confirmed without marking as fixed leaves state unchanged',
@@ -2094,18 +2108,6 @@ for my $test (
},
) {
subtest $test->{desc} => sub {
- $mech->log_in_ok( $report->user->email );
-
- my %standard_fields = (
- name => $report->user->name,
- update => 'update text',
- photo1 => '',
- photo2 => '',
- photo3 => '',
- may_show_name => 1,
- add_alert => 1,
- );
-
my %expected_fields = (
%standard_fields,
%{ $test->{expected_form_fields} },
@@ -2178,4 +2180,11 @@ FixMyStreet::override_config {
};
};
+subtest 'check disabling of updates per category' => sub {
+ $contact->set_extra_metadata( updates_disallowed => 1 );
+ $contact->update;
+ $mech->get_ok("/report/$report_id");
+ $mech->content_lacks('Provide an update');
+};
+
done_testing();