Lines 14-20
my $dbh = C4::Context->dbh;
Link Here
|
14 |
$dbh->{AutoCommit} = 0; |
14 |
$dbh->{AutoCommit} = 0; |
15 |
$dbh->{RaiseError} = 1; |
15 |
$dbh->{RaiseError} = 1; |
16 |
|
16 |
|
17 |
my $t = Test::Mojo->new('Koha::REST'); |
17 |
my $t = Test::Mojo->new('Koha::REST::V1'); |
18 |
|
18 |
|
19 |
my $categorycode = Koha::Database->new()->schema()->resultset('Category')->first()->categorycode(); |
19 |
my $categorycode = Koha::Database->new()->schema()->resultset('Category')->first()->categorycode(); |
20 |
my $branchcode = Koha::Database->new()->schema()->resultset('Branch')->first()->branchcode(); |
20 |
my $branchcode = Koha::Database->new()->schema()->resultset('Branch')->first()->branchcode(); |
Lines 26-35
$borrower->surname("Test Surname");
Link Here
|
26 |
$borrower->store; |
26 |
$borrower->store; |
27 |
my $borrowernumber = $borrower->borrowernumber; |
27 |
my $borrowernumber = $borrower->borrowernumber; |
28 |
|
28 |
|
29 |
$t->get_ok('/borrowers') |
29 |
$t->get_ok('/v1/borrowers') |
30 |
->status_is(200); |
30 |
->status_is(200); |
31 |
|
31 |
|
32 |
$t->get_ok("/borrowers/$borrowernumber") |
32 |
$t->get_ok("/v1/borrowers/$borrowernumber") |
33 |
->status_is(200) |
33 |
->status_is(200) |
34 |
->json_is('/borrowernumber' => $borrowernumber) |
34 |
->json_is('/borrowernumber' => $borrowernumber) |
35 |
->json_is('/surname' => "Test Surname"); |
35 |
->json_is('/surname' => "Test Surname"); |
36 |
- |
|
|