Lines 45-51
my $t = Test::Mojo->new('Koha::REST::V1');
Link Here
|
45 |
|
45 |
|
46 |
subtest 'get() tests' => sub { |
46 |
subtest 'get() tests' => sub { |
47 |
|
47 |
|
48 |
plan tests => 21; |
48 |
plan tests => 22; |
49 |
|
49 |
|
50 |
$schema->storage->txn_begin; |
50 |
$schema->storage->txn_begin; |
51 |
|
51 |
|
Lines 124-129
subtest 'get() tests' => sub {
Link Here
|
124 |
like( $result, qr/\Q$encoded_title/, "The title is not double encoded" ); |
124 |
like( $result, qr/\Q$encoded_title/, "The title is not double encoded" ); |
125 |
}; |
125 |
}; |
126 |
|
126 |
|
|
|
127 |
subtest 'marcxml encoding tests' => sub { |
128 |
plan tests => 3; |
129 |
|
130 |
my $marcflavour = C4::Context->preference('marcflavour'); |
131 |
t::lib::Mocks::mock_preference('marcflavour', 'UNIMARC'); |
132 |
|
133 |
|
134 |
my $title_with_diacritics = "L'insoutenable légèreté de l'être"; |
135 |
|
136 |
my $biblio = $builder->build_sample_biblio( |
137 |
{ |
138 |
title => $title_with_diacritics, |
139 |
author => "Milan Kundera" |
140 |
} |
141 |
); |
142 |
|
143 |
my $record = $biblio->metadata->record; |
144 |
$record->leader(' nam 3 4500'); |
145 |
$biblio->metadata->metadata($record->as_xml_record('UNIMARC')); |
146 |
$biblio->metadata->store; |
147 |
|
148 |
my $result = $t->get_ok( "//$userid:$password@/api/v1/biblios/" . $biblio->biblionumber |
149 |
=> { Accept => 'application/marcxml+xml' } ) |
150 |
->status_is(200)->tx->res->body; |
151 |
|
152 |
my $encoded_title = Encode::encode( "UTF-8", $title_with_diacritics ); |
153 |
|
154 |
like( $result, qr/\Q$encoded_title/, "The title is not double encoded" ); |
155 |
t::lib::Mocks::mock_preference('marcflavour', $marcflavour); |
156 |
}; |
157 |
|
127 |
$schema->storage->txn_rollback; |
158 |
$schema->storage->txn_rollback; |
128 |
}; |
159 |
}; |
129 |
|
160 |
|
130 |
- |
|
|