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

(-)a/t/db_dependent/api/v1/bookings.t (-10 / +4 lines)
Lines 224-230 subtest 'add() tests' => sub { Link Here
224
    my $unauth_userid = $patron->userid;
224
    my $unauth_userid = $patron->userid;
225
225
226
    my $biblio  = $builder->build_sample_biblio;
226
    my $biblio  = $builder->build_sample_biblio;
227
    my $item    = $builder->build_sample_item( { bookable => 1, biblionumber => $biblio->id } );
227
    my $item1   = $builder->build_sample_item( { bookable => 1, biblionumber => $biblio->id } );
228
    my $item2   = $builder->build_sample_item( { bookable => 1, biblionumber => $biblio->id } );
228
    my $booking = {
229
    my $booking = {
229
        biblio_id  => $biblio->id,
230
        biblio_id  => $biblio->id,
230
        item_id    => undef,
231
        item_id    => undef,
Lines 261-274 subtest 'add() tests' => sub { Link Here
261
262
262
    # Authorized attempt to create with existing id
263
    # Authorized attempt to create with existing id
263
    $booking->{booking_id} = $booking_id;
264
    $booking->{booking_id} = $booking_id;
264
    $t->post_ok( "//$userid:$password@/api/v1/bookings" => json => $booking )->status_is(400)->json_is(
265
    $t->post_ok( "//$userid:$password@/api/v1/bookings" => json => $booking )->status_is(400)
265
        "/errors" => [
266
        ->json_is( "/error" => "Duplicate booking_id" );
266
            {
267
                message => "Read-only.",
268
                path    => "/body/booking_id"
269
            }
270
        ]
271
    );
272
267
273
    # TODO: Test bookings clashes
268
    # TODO: Test bookings clashes
274
    # TODO: Test item auto-assignment
269
    # TODO: Test item auto-assignment
275
- 

Return to bug 36100