BEGIN; SELECT plan(1); ------------------------- -- Setup test environment -- Circ modifier -- Vandelay settings (queue, import_item_attr_definition) -- Bib record added to Vandelay queue -- including items with stat cat data ------------------------- INSERT INTO config.circ_modifier (code, name, description, sip2_media_type) VALUES ('TEST', 'TEST', 'TEST', 'TEST'); INSERT INTO vandelay.import_item_attr_definition ( owner, name, tag, owning_lib, circ_lib, call_number, internal_id, status, location, barcode, circ_modifier, stat_cat_data) VALUES ( 1, 'TEST', '999', 'b', 'b', 'j', 'e', 'z', 'c', 'p', 'a', 'd'); INSERT INTO vandelay.bib_queue (owner, name, item_attr_def) VALUES (1, 'TEST', CURRVAL('vandelay.import_item_attr_definition_id_seq')); ---------------------- -- Add record to queue -- This triggers ingest_bib_items() -- which calls ingest_items() ---------------------- INSERT INTO vandelay.queued_bib_record (queue, bib_source, marc) VALUES ( CURRVAL('vandelay.queue_id_seq'), 2, '01532nam a22003138a 4500996CONS20140910210953.0070119s2009 nyua j 000 1 eng 200610044123297771397800608089 (trade bdg.)testGaiman, Neil.Blueberry girl 2 /written by Neil Gaiman.1st ed.New York :HarperCollinsPublishers,2009.TESTBR1StacksItem Category 1|EBOOK4674HV 1431 .S76 1990SC1001nonreferenceholdablecirculatingvisibleAvailableTESTBR1Stacks4675HV 1431 .S76 1990TESTSC1002nonreferenceholdablecirculatingvisibleAvailableTESTBR1StacksItem Category 1|EBOOK||Item Category 2|E-PROJECT MUSEHV 1431 .S76 1990SC3003nonreferenceholdablecirculatingvisibleAvailableTESTBR1StacksHV 1431 .S76 1990SC3004nonreferenceholdablecirculatingvisibleAvailable' ); ------------------- -- Test the results ------------------- SELECT is( ( SELECT count(*) FROM vandelay.import_item WHERE record = CURRVAL('vandelay.queued_record_id_seq') AND stat_cat_data IS NOT NULL ), 2::bigint, 'Stat cat data?' ); ROLLBACK;