aboutsummaryrefslogtreecommitdiffstats
path: root/t/open311.t
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2018-10-05 14:27:46 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2018-10-09 11:54:50 +0100
commit38fe802b9bb5cbb749d8f4c39cefc043b8c046cd (patch)
treeca514812d0813647a7457bc193648350a2098f8c /t/open311.t
parent2c24318939d310100559b0bc8aed663ff940ce22 (diff)
[Open311] Move send-comments code to package.
Diffstat (limited to 't/open311.t')
-rw-r--r--t/open311.t20
1 files changed, 19 insertions, 1 deletions
diff --git a/t/open311.t b/t/open311.t
index e1ad578d7..ef52eb538 100644
--- a/t/open311.t
+++ b/t/open311.t
@@ -415,10 +415,26 @@ foreach my $test (
status => 'OPEN',
extended => 'IN_PROGRESS',
},
+ {
+ desc => 'comment that marks problem open sends OPEN if not mark_reopen',
+ state => 'confirmed',
+ status => 'OPEN',
+ extended => 'OPEN',
+ mark_open => 1,
+ },
+ {
+ desc => 'comment that marks problem open sends REOPEN if mark_reopen',
+ state => 'confirmed',
+ status => 'OPEN',
+ extended => 'REOPEN',
+ mark_open => 1,
+ mark_reopen => 1,
+ },
) {
subtest $test->{desc} => sub {
$comment->problem_state( $test->{state} );
$comment->problem->state( $test->{state} );
+ $comment->mark_open(1) if $test->{mark_open};
my $results = make_update_req( $comment, '<?xml version="1.0" encoding="utf-8"?><service_request_updates><request_update><update_id>248</update_id></request_update></service_request_updates>' );
@@ -426,7 +442,9 @@ foreach my $test (
is $c->param('status'), $test->{status}, 'correct status';
if ( $test->{extended} ) {
- my $results = make_update_req( $comment, '<?xml version="1.0" encoding="utf-8"?><service_request_updates><request_update><update_id>248</update_id></request_update></service_request_updates>', { extended_statuses => 1 } );
+ my $params = { extended_statuses => 1 };
+ $params->{mark_reopen} = 1 if $test->{mark_reopen};
+ my $results = make_update_req( $comment, '<?xml version="1.0" encoding="utf-8"?><service_request_updates><request_update><update_id>248</update_id></request_update></service_request_updates>', $params );
my $c = CGI::Simple->new( $results->{ req }->content );
is $c->param('status'), $test->{extended}, 'correct extended status';
}