diff options
author | Struan Donald <struan@exo.org.uk> | 2017-09-13 09:52:12 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2017-09-13 09:52:12 +0100 |
commit | a181c520986498ab5a898ad3c21c04affa215378 (patch) | |
tree | 9630a7b97fd57081f9175741cdeeeb8046d39d32 /t/app/controller/admin.t | |
parent | 81744445eedc8686827cfc119b51ae8ec704a963 (diff) | |
parent | e2225f14211e061330223b9f752b7924610bc0f9 (diff) |
Merge branch 'issues/forcouncils/224-default-priority'
Diffstat (limited to 't/app/controller/admin.t')
-rw-r--r-- | t/app/controller/admin.t | 20 |
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 ); |