aboutsummaryrefslogtreecommitdiffstats
path: root/t/app
diff options
context:
space:
mode:
Diffstat (limited to 't/app')
-rw-r--r--t/app/controller/admin.t1
-rw-r--r--t/app/controller/contact.t4
-rw-r--r--t/app/controller/my_planned.t10
-rw-r--r--t/app/sendreport/inspection_required.t20
4 files changed, 28 insertions, 7 deletions
diff --git a/t/app/controller/admin.t b/t/app/controller/admin.t
index 8c3cde4b7..7ba84b652 100644
--- a/t/app/controller/admin.t
+++ b/t/app/controller/admin.t
@@ -1165,6 +1165,7 @@ my %default_perms = (
"permissions[template_edit]" => undef,
"permissions[responsepriority_edit]" => undef,
"permissions[category_edit]" => undef,
+ trusted_bodies => undef,
);
FixMyStreet::override_config {
diff --git a/t/app/controller/contact.t b/t/app/controller/contact.t
index dd94fc431..7c2769b9c 100644
--- a/t/app/controller/contact.t
+++ b/t/app/controller/contact.t
@@ -250,7 +250,7 @@ for my $test (
$mech->get_ok('/contact');
}
$mech->submit_form_ok( { with_fields => $test->{fields} } );
- $mech->content_contains('Thank you for your feedback');
+ $mech->content_contains('Thank you for your enquiry');
my $email = $mech->get_email;
@@ -376,7 +376,7 @@ for my $test (
$mech->clear_emails_ok;
$mech->get_ok('/contact');
$mech->submit_form_ok( { with_fields => $test->{fields} } );
- $mech->content_contains('Thank you for your feedback');
+ $mech->content_contains('Thank you for your enquiry');
$mech->email_count_is(1);
}
};
diff --git a/t/app/controller/my_planned.t b/t/app/controller/my_planned.t
index 25f82224e..7bd1dd2cd 100644
--- a/t/app/controller/my_planned.t
+++ b/t/app/controller/my_planned.t
@@ -13,8 +13,8 @@ my $body = $mech->create_body_ok(2237, 'Oxfordshire');
my ($problem) = $mech->create_problems_for_body(1, $body->id, 'Test Title');
$mech->get_ok($problem->url);
-$mech->content_lacks('Add to planned reports');
-$mech->content_lacks('Remove from planned reports');
+$mech->content_lacks('Shortlist');
+$mech->content_lacks('Shortlisted');
my $user = $mech->log_in_ok( 'test@example.com' );
$user->update({ from_body => $body });
@@ -39,11 +39,11 @@ $mech->get_ok('/my/planned');
$mech->content_contains('Test Title');
$mech->get_ok($problem->url);
-$mech->content_contains('Remove from planned reports');
+$mech->content_contains('Shortlisted');
$mech->submit_form_ok({ with_fields => { change => 'remove' } });
-$mech->content_contains('Add to planned reports');
+$mech->content_contains('Shortlist');
$mech->submit_form_ok({ with_fields => { change => 'add' } });
-$mech->content_contains('Remove from planned reports');
+$mech->content_contains('Shortlisted');
done_testing();
diff --git a/t/app/sendreport/inspection_required.t b/t/app/sendreport/inspection_required.t
index 178fa2a1f..88a48e991 100644
--- a/t/app/sendreport/inspection_required.t
+++ b/t/app/sendreport/inspection_required.t
@@ -52,8 +52,28 @@ subtest 'Report is sent when inspected' => sub {
ok $report->whensent, 'Report marked as sent';
};
+subtest 'Uninspected report is sent when made by trusted user' => sub {
+ $mech->clear_emails_ok;
+ $report->unset_extra_metadata('inspected');
+ $report->whensent( undef );
+ $report->update;
+
+ $user->user_body_permissions->find_or_create({
+ body => $body,
+ permission_type => 'trusted',
+ });
+ ok $user->has_permission_to('trusted', $report->bodies_str_ids), 'User can make trusted reports';
+
+ FixMyStreet::DB->resultset('Problem')->send_reports();
+
+ $report->discard_changes;
+ $mech->email_count_is( 1 );
+ ok $report->whensent, 'Report marked as sent';
+};
+
done_testing();
END {
+ $mech->delete_user($user);
$mech->delete_body($body);
}