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

(-)a/t/db_dependent/www/batch.t (-2 / +13 lines)
Lines 19-25 Link Here
19
use Modern::Perl;
19
use Modern::Perl;
20
20
21
use utf8;
21
use utf8;
22
use Test::More tests => 20;
22
use Test::More tests => 24;
23
use Test::WWW::Mechanize;
23
use Test::WWW::Mechanize;
24
use XML::Simple;
24
use XML::Simple;
25
use JSON;
25
use JSON;
Lines 178-183 $agent->get_ok( Link Here
178
);
178
);
179
$jsonresponse = decode_json $agent->content;
179
$jsonresponse = decode_json $agent->content;
180
like( $jsonresponse->{ aaData }[0]->{ citation }, qr/$bookdescription/, 'found book' );
180
like( $jsonresponse->{ aaData }[0]->{ citation }, qr/$bookdescription/, 'found book' );
181
is( $jsonresponse->{ aaData }[0]->{ status }, 'staged', 'record marked as staged' );
182
is( $jsonresponse->{ aaData }[0]->{ overlay_status }, 'no_match', 'record has no matches' );
183
181
my $biblionumber = $jsonresponse->{ aaData }[0]->{ import_record_id };
184
my $biblionumber = $jsonresponse->{ aaData }[0]->{ import_record_id };
182
# Back to the manage staged records page
185
# Back to the manage staged records page
183
$agent->get($staged_records_uri);
186
$agent->get($staged_records_uri);
Lines 185-190 $agent->form_number(6); Link Here
185
$agent->field( 'framework', '' );
188
$agent->field( 'framework', '' );
186
$agent->click_ok( 'mainformsubmit', "imported records into catalog" );
189
$agent->click_ok( 'mainformsubmit', "imported records into catalog" );
187
190
191
$agent->get("$intranet/cgi-bin/koha/tools/batch_records_ajax.pl?import_batch_id=$import_batch_id");
192
$jsonresponse = decode_json $agent->content;
193
is( $jsonresponse->{ aaData }[0]->{ status }, 'imported', 'record marked as imported' );
194
195
$agent->get($staged_records_uri);
188
$agent->form_number(5);
196
$agent->form_number(5);
189
$agent->click_ok( 'mainformsubmit', "revert import" );
197
$agent->click_ok( 'mainformsubmit', "revert import" );
190
$agent->get_ok(
198
$agent->get_ok(
Lines 193-196 $agent->get_ok( Link Here
193
$agent->content_contains( 'The record you requested does not exist',
201
$agent->content_contains( 'The record you requested does not exist',
194
    'bib is gone' );
202
    'bib is gone' );
195
203
204
$agent->get("$intranet/cgi-bin/koha/tools/batch_records_ajax.pl?import_batch_id=$import_batch_id");
205
$jsonresponse = decode_json $agent->content;
206
is( $jsonresponse->{ aaData }[0]->{ status }, 'reverted', 'record marked as reverted' );
207
196
1;
208
1;
197
- 

Return to bug 16423