LP#1533329: bail out of live Perl test if opt-in not enabled
authorGalen Charlton <gmc@esilibrary.com>
Thu, 3 Mar 2016 02:07:09 +0000 (21:07 -0500)
committerGalen Charlton <gmc@esilibrary.com>
Thu, 3 Mar 2016 02:07:09 +0000 (21:07 -0500)
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Open-ILS/src/perlmods/live_t/12-lp1533329-opt-in.t

index cdf9019..31b69ab 100644 (file)
@@ -35,6 +35,14 @@ sub new_org_setting {
     return $set;
 }
 
+sub opt_in_enabled {
+    my $resp = $U->simplereq(
+        'open-ils.actor',
+        'open-ils.actor.user.org_unit_opt_in.enabled'
+    );
+    return $resp;
+}
+
 # do an opt-in check
 sub opt_in_check {
     my ($authtoken, $usr_id) = @_;
@@ -45,6 +53,10 @@ sub opt_in_check {
     return $resp;
 }
 
+unless(opt_in_enabled()) {
+    BAIL_OUT('cannot test opt-in unless enabled in opensrf.xml');
+}
+
 #----------------------------------------------------------------
 # 1. Login, register workstation, get authtoken.
 #----------------------------------------------------------------