aboutsummaryrefslogtreecommitdiffstats
path: root/t/open311.t
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2018-10-09 11:57:06 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2018-10-09 11:57:06 +0100
commit0f7571bffcf898faf3a93c7aa595614ea5febc04 (patch)
tree31c4cd45cd5186a4098946742f0089c9cb81488f /t/open311.t
parentf738e18d1dc27aa1dbba0695a4d54d15ecd4cbf4 (diff)
parent097b57c516231b5c500ab521af5d52cf403ea88e (diff)
Merge branch 'send-reopen-comment-option'
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';
}