From 3abfe8a00b3eff86ef0df636141351012b24fc8e Mon Sep 17 00:00:00 2001 From: Jason Stephenson Date: Sun, 26 Jan 2014 14:55:36 -0500 Subject: [PATCH] LP1198475: Add pgTAP tests for lost and paid status. Test for existence of the copy status and the two new org_unit settings to control if the copy status and stop fines reason are used. Signed-off-by: Jason Stephenson Signed-off-by: Kathy Lussier --- .../src/sql/Pg/t/lp1198475-lost-and-paid-status.pg | 40 ++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 Open-ILS/src/sql/Pg/t/lp1198475-lost-and-paid-status.pg diff --git a/Open-ILS/src/sql/Pg/t/lp1198475-lost-and-paid-status.pg b/Open-ILS/src/sql/Pg/t/lp1198475-lost-and-paid-status.pg new file mode 100644 index 0000000000..2f88fb800b --- /dev/null +++ b/Open-ILS/src/sql/Pg/t/lp1198475-lost-and-paid-status.pg @@ -0,0 +1,40 @@ +\set ECHO +\set QUIET 1 +-- Turn off echo and keep things quiet. + +-- Format the output for nice TAP. +\pset format unaligned +\pset tuples_only true +\pset pager + +-- Revert all changes on failure. +\set ON_ERROR_ROLLBACK 1 +\set ON_ERROR_STOP true +\set QUIET 1 + +-- Load the TAP functions. +BEGIN; + +-- Plan the tests. +SELECT plan(3); + +-- Run the tests. +-- Check for Lost and Paid copy status. +SELECT isnt_empty( + 'SELECT * FROM config.copy_status WHERE id = 17', + 'Lost and Paid copy status exists' +); + +--Check for org_unit settings. +SELECT isnt_empty( + 'SELECT * FROM config.org_unit_setting_type WHERE name = $$circ.use_lost_paid_stop_fines$$', + 'circ.use_lost_paid_stop_fines exists' +); +SELECT isnt_empty( + 'SELECT * FROM config.org_unit_setting_type WHERE name = $$circ.use_lost_paid_copy_status$$', + 'circ.use_lost_paid_copy_status exists' +); + +-- Finish the tests and clean up. +SELECT * FROM finish(); +ROLLBACK; -- 2.11.0