LP1198475: Add pgTAP tests for lost and paid status.
authorJason Stephenson <jason@sigio.com>
Sun, 26 Jan 2014 19:55:36 +0000 (14:55 -0500)
committerKathy Lussier <klussier@masslnc.org>
Tue, 3 Jun 2014 16:59:32 +0000 (12:59 -0400)
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 <jason@sigio.com>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Open-ILS/src/sql/Pg/t/lp1198475-lost-and-paid-status.pg [new file with mode: 0644]

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 (file)
index 0000000..2f88fb8
--- /dev/null
@@ -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;