aboutsummaryrefslogtreecommitdiffstats
path: root/t/app/controller/admin.t
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2017-09-08 17:19:57 +0100
committerStruan Donald <struan@exo.org.uk>2017-09-13 09:50:02 +0100
commitd9c0917b84d501e6cfca7e0113470997b6ff2f35 (patch)
treebc33bfc24b72b0c44ecc398ba9d92573543f93c6 /t/app/controller/admin.t
parent0998aef4fb4e7e94b950a6b337ee0c0df72ec7de (diff)
edit and display default response priority in admin
Diffstat (limited to 't/app/controller/admin.t')
-rw-r--r--t/app/controller/admin.t20
1 files changed, 20 insertions, 0 deletions
diff --git a/t/app/controller/admin.t b/t/app/controller/admin.t
index 075ab0fd0..bd0f9e408 100644
--- a/t/app/controller/admin.t
+++ b/t/app/controller/admin.t
@@ -1470,6 +1470,7 @@ subtest "response priorities can be added" => sub {
name => "Cat 1A",
description => "Fixed within 24 hours",
deleted => undef,
+ is_default => undef,
"contacts[".$oxfordshirecontact->id."]" => 1,
};
$mech->submit_form_ok( { with_fields => $fields } );
@@ -1478,6 +1479,25 @@ subtest "response priorities can be added" => sub {
is $oxfordshirecontact->response_priorities->count, 1, "Response template was added to contact";
};
+subtest "response priorities can set to default" => sub {
+ my $priority_id = $oxfordshire->response_priorities->first->id;
+ is $oxfordshire->response_priorities->count, 1, "Response priority exists";
+ $mech->get_ok( "/admin/responsepriorities/" . $oxfordshire->id . "/$priority_id" );
+
+ my $fields = {
+ name => "Cat 1A",
+ description => "Fixed within 24 hours",
+ deleted => undef,
+ is_default => 1,
+ "contacts[".$oxfordshirecontact->id."]" => 1,
+ };
+ $mech->submit_form_ok( { with_fields => $fields } );
+
+ is $oxfordshire->response_priorities->count, 1, "Still one response priority";
+ is $oxfordshirecontact->response_priorities->count, 1, "Still one response template";
+ ok $oxfordshire->response_priorities->first->is_default, "Response priority set to default";
+};
+
subtest "response priorities can be listed" => sub {
$mech->get_ok( "/admin/responsepriorities/" . $oxfordshire->id );