[Rt-commit] rt branch, 5.0/rest2-ticket-more-updates, repushed

? sunnavy sunnavy at bestpractical.com
Thu Dec 31 14:06:03 EST 2020


The branch 5.0/rest2-ticket-more-updates was deleted and repushed:
       was 32c5ecc11a1891a838ef084e582605988c0d3032
       now 464ee2491cfa024a9697dd991674747f6c5a3700

1: 274280cdc4 ! 1: 51e81b7c2d Support to merge tickets in REST2
    @@ -39,11 +39,11 @@
     +    my $data = shift;
     +
     +    my @results;
    ++    push @results, $self->_update_record($data);
     +    if ( my $ticket_id = delete $data->{MergeInto} ) {
     +        my ( $ok, $msg ) = $self->record->MergeInto($ticket_id);
     +        push @results, $msg;
     +    }
    -+    push @results, $self->_update_record($data);
     +    return @results;
     +}
     +
2: c12d03bcda < -:  ------- Support to take/untake/steal tickets in REST2
-:  ------- > 2: 71333f6661 Support to take/untake/steal tickets in REST2
3: 70d39dd1a1 = 3: 4a7f98165f Test ticket merge in REST2
4: 32c5ecc11a ! 4: 464ee2491c Test ticket steal/take/untake in REST2
    @@ -1,6 +1,19 @@
     Author: sunnavy <sunnavy at bestpractical.com>
     
         Test ticket steal/take/untake in REST2
    +
    +diff --git a/lib/RT/Test/REST2.pm b/lib/RT/Test/REST2.pm
    +--- a/lib/RT/Test/REST2.pm
    ++++ b/lib/RT/Test/REST2.pm
    +@@
    +         my ($self, $url, $payload, %headers) = @_;
    +         $self->put(
    +             $url,
    +-            Content => $json->encode($payload),
    ++            $payload ? ( Content => $json->encode($payload) ) : (),
    +             'Content-Type' => 'application/json; charset=utf-8',
    +             %headers,
    +         );
     
     diff --git a/t/rest2/tickets.t b/t/rest2/tickets.t
     --- a/t/rest2/tickets.t
    @@ -17,16 +30,13 @@
     +    $user->PrincipalObj->GrantRight( Right => 'OwnTicket' );
     +
     +    my %result = (
    -+        Steal  => 'Owner changed from root to test',
    -+        Untake => 'Owner changed from test to Nobody',
    -+        Take   => 'Owner changed from Nobody to test',
    ++        steal  => 'Owner changed from root to test',
    ++        untake => 'Owner changed from test to Nobody',
    ++        take   => 'Owner changed from Nobody to test',
     +    );
     +
    -+    for my $action (qw/Steal Untake Take/) {
    -+        my $payload = { $action => 1 };
    -+
    -+        # update again with no changes
    -+        $res = $mech->put_json( $ticket_url, $payload, 'Authorization' => $auth, );
    ++    for my $action (qw/steal untake take/) {
    ++        $res = $mech->put_json( "$ticket_url/$action", undef, 'Authorization' => $auth, );
     +        is( $res->code, 200 );
     +        is_deeply( $mech->json_response, [ $result{$action} ] );
     +    }



More information about the rt-commit mailing list