LP1841871: Add a test for creating authority record from bib field
authorJane Sandberg <sandbej@linnbenton.edu>
Thu, 29 Aug 2019 03:05:09 +0000 (20:05 -0700)
committerGalen Charlton <gmc@equinoxOLI.org>
Tue, 21 Feb 2023 21:15:56 +0000 (16:15 -0500)
Signed-off-by: Jane Sandberg <sandbej@linnbenton.edu>
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Open-ILS/src/perlmods/live_t/29-create-authority-record-from-bib-field.t [new file with mode: 0644]

diff --git a/Open-ILS/src/perlmods/live_t/29-create-authority-record-from-bib-field.t b/Open-ILS/src/perlmods/live_t/29-create-authority-record-from-bib-field.t
new file mode 100644 (file)
index 0000000..0c874e4
--- /dev/null
@@ -0,0 +1,30 @@
+#!perl
+
+use Test::More tests => 1;
+
+diag("Test creating authority records from a bibliographic field.");
+
+use strict; use warnings;
+
+use OpenILS::Utils::TestUtils;
+my $script = OpenILS::Utils::TestUtils->new();
+$script->bootstrap;
+
+our $apputils   = "OpenILS::Application::AppUtils";
+
+my $field = {
+    'tag' => '710',
+    'ind1' => '2',
+    'subfields' => [['a', 'Evergreen Club Contemporary Gamelan']]
+    };
+my $resp = $apputils->simplereq(
+    'open-ils.cat',
+    'open-ils.cat.authority.record.create_from_bib.readonly',
+    $field,
+    'catLibrary'
+);
+
+like($resp,
+    '/<datafield tag=\"110\" ind1=\"2\" ind2=\" \"><subfield code=\"a\">Evergreen Club Contemporary Gamelan<\/subfield><\/datafield>/',
+    'Can create an authority record from a bib field');
+