aboutsummaryrefslogtreecommitdiffstats
path: root/t/app/controller
diff options
context:
space:
mode:
Diffstat (limited to 't/app/controller')
-rw-r--r--t/app/controller/admin.t1
-rw-r--r--t/app/controller/admin_permissions.t2
-rw-r--r--t/app/controller/report_as_other.t14
3 files changed, 17 insertions, 0 deletions
diff --git a/t/app/controller/admin.t b/t/app/controller/admin.t
index 069e00b5e..075ab0fd0 100644
--- a/t/app/controller/admin.t
+++ b/t/app/controller/admin.t
@@ -1177,6 +1177,7 @@ my %default_perms = (
"permissions[report_inspect]" => undef,
"permissions[report_instruct]" => undef,
"permissions[contribute_as_another_user]" => undef,
+ "permissions[contribute_as_anonymous_user]" => undef,
"permissions[contribute_as_body]" => undef,
"permissions[view_body_contribute_details]" => undef,
"permissions[user_edit]" => undef,
diff --git a/t/app/controller/admin_permissions.t b/t/app/controller/admin_permissions.t
index 0997e1e38..7944cc0b1 100644
--- a/t/app/controller/admin_permissions.t
+++ b/t/app/controller/admin_permissions.t
@@ -146,6 +146,7 @@ FixMyStreet::override_config {
"permissions[report_inspect]" => undef,
"permissions[report_instruct]" => undef,
"permissions[contribute_as_another_user]" => undef,
+ "permissions[contribute_as_anonymous_user]" => undef,
"permissions[contribute_as_body]" => undef,
"permissions[user_edit]" => undef,
"permissions[user_manage_permissions]" => undef,
@@ -178,6 +179,7 @@ FixMyStreet::override_config {
"permissions[report_inspect]" => undef,
"permissions[report_instruct]" => undef,
"permissions[contribute_as_another_user]" => undef,
+ "permissions[contribute_as_anonymous_user]" => undef,
"permissions[contribute_as_body]" => undef,
"permissions[user_edit]" => undef,
"permissions[user_manage_permissions]" => undef,
diff --git a/t/app/controller/report_as_other.t b/t/app/controller/report_as_other.t
index 86c2deb93..326b3c906 100644
--- a/t/app/controller/report_as_other.t
+++ b/t/app/controller/report_as_other.t
@@ -76,6 +76,20 @@ subtest "Body user, has permission to add report as another (existing) user" =>
push @users, $report->user;
};
+subtest "Body user, has permission to add report as anonymous user" => sub {
+ my $report = add_report(
+ 'contribute_as_anonymous_user',
+ form_as => 'anonymous_user',
+ title => "Test Report",
+ detail => 'Test report details.',
+ category => 'Street lighting',
+ );
+ is $report->name, 'Oxfordshire County Council', 'report name is body';
+ is $report->user->name, 'Body User', 'user name unchanged';
+ is $report->user->id, $user->id, 'user matches';
+ is $report->anonymous, 1, 'report anonymous';
+};
+
subtest "Body user, has permission to add update as council" => sub {
my $update = add_update(
'contribute_as_body',