View | Details | Raw Unified | Return to bug 29810
Collapse All | Expand All

(-)a/t/db_dependent/api/v1/acquisitions_orders.t (-4 / +3 lines)
Lines 112-119 subtest 'list() tests' => sub { Link Here
112
112
113
    my $query = { "biblio.isbn" => { "-like" => "\%SOMETHING\%" } };
113
    my $query = { "biblio.isbn" => { "-like" => "\%SOMETHING\%" } };
114
114
115
    $t->get_ok( "//$userid:$password@/api/v1/acquisitions/orders?q=" . encode_json($query) => {'x-koha-embed' => 'biblio'} )
115
    $t->get_ok( "//$userid:$password@/api/v1/acquisitions/orders?q=" . encode_json($query) => {'x-koha-embed' => 'biblio' } )
116
      ->status_is( 200, "Embeddig biblio.isbn doesn't make it explode" )
116
      ->status_is( 200, "Embedding biblio and searching on biblio.isbn doesn't make it explode" )->or( sub { diag $t->tx->res->to_string } )
117
      ->json_has( "/0/biblio", "biblio object correctly embedded" )
117
      ->json_has( "/0/biblio", "biblio object correctly embedded" )
118
      ->json_is( "/0/biblio/isbn", 'SOMETHING', 'Filtering by a biblioitems column works!' );
118
      ->json_is( "/0/biblio/isbn", 'SOMETHING', 'Filtering by a biblioitems column works!' );
119
119
Lines 206-212 subtest 'list() tests' => sub { Link Here
206
206
207
        $result =
207
        $result =
208
          $t->get_ok( "//$userid:$password@/api/v1/acquisitions/orders?_order_by=-biblio.isbn,+biblio.ean,-biblio.publisher&basket_id=" . $basket->id => {'x-koha-embed' => 'biblio'} )
208
          $t->get_ok( "//$userid:$password@/api/v1/acquisitions/orders?_order_by=-biblio.isbn,+biblio.ean,-biblio.publisher&basket_id=" . $basket->id => {'x-koha-embed' => 'biblio'} )
209
            ->status_is( 200, "query successful" )
209
            ->status_is( 200, "query successful" )->or( sub { diag $t->tx->res->to_string } )
210
            ->tx->res->json;
210
            ->tx->res->json;
211
211
212
        is( $result->[0]->{order_id}, $order_2->id, 'Ordered correctly' );
212
        is( $result->[0]->{order_id}, $order_2->id, 'Ordered correctly' );
213
- 

Return to bug 29810