Bug 17836: (ILSDI) Regression test
authorTomas Cohen Arazi <tomascohen@theke.io>
Tue, 3 Jan 2017 16:13:32 +0000 (13:13 -0300)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 20 Jan 2017 13:44:57 +0000 (13:44 +0000)
Sponsored-by: ByWater Solutions
Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
t/db_dependent/ILSDI_Services.t

index 15806a6..88e8181 100644 (file)
@@ -20,6 +20,7 @@ use Modern::Perl;
 use CGI qw ( -utf8 );
 
 use Test::More tests => 3;
+use Test::MockModule;
 use t::lib::Mocks;
 use t::lib::TestBuilder;
 
@@ -94,7 +95,7 @@ subtest 'AuthenticatePatron test' => sub {
 
 subtest 'GetPatronInfo/GetBorrowerAttributes test for extended patron attributes' => sub {
 
-    plan tests => 1;
+    plan tests => 2;
 
     $schema->storage->txn_begin;
 
@@ -165,6 +166,9 @@ subtest 'GetPatronInfo/GetBorrowerAttributes test for extended patron attributes
         }
     } );
 
+    my $members = Test::MockModule->new('C4::Members');
+    $members->mock( 'GetMemberAccountBalance', sub { return ( 10, 10, 0 ); } );
+
     # Prepare and send web request for IL-SDI server:
     my $query = new CGI;
     $query->param( 'service', 'GetPatronInfo' );
@@ -184,6 +188,9 @@ subtest 'GetPatronInfo/GetBorrowerAttributes test for extended patron attributes
         value_description => undef,
     };
 
+    is( $reply->{'charges'}, '10.00',
+        'The \'charges\' attribute should be correctly filled (bug 17836)' );
+
     # Check results:
     is_deeply( $reply->{'attributes'}, [ $cmp ], 'Test GetPatronInfo - show_attributes parameter' );