diff --git a/lib/call_attempt_repo.rb b/lib/call_attempt_repo.rb index 52cc5f09c5907bb0864251ef5708c12626bc9ad5..fd7e8d7801d065f9a263ae35e0cf35be9015c59a 100644 --- a/lib/call_attempt_repo.rb +++ b/lib/call_attempt_repo.rb @@ -52,7 +52,7 @@ protected customer_id=$1 AND start > DATE_TRUNC('month', LOCALTIMESTAMP) SQL - promise.then { |rows| -(rows.first&.dig("a") || 0) } + promise.then { |rows| rows.first&.dig("a") || 0 } end def find_rate(plan_name, other_tel, direction) diff --git a/test/test_web.rb b/test/test_web.rb index 00fa42323de31aeb9f2a7be7a928d0ba8d627159..5f5e8106e59a1c22e47aa5e152319580df930894 100644 --- a/test/test_web.rb +++ b/test/test_web.rb @@ -82,9 +82,9 @@ class WebTest < Minitest::Test db: FakeDB.new( ["test_usd", "+15557654321", :outbound] => [{ "rate" => 0.01 }], ["test_usd", "+15557654321", :inbound] => [{ "rate" => 0.01 }], - ["customerid_limit"] => [{ "a" => -1000 }], - ["customerid_low"] => [{ "a" => -1000 }], - ["customerid_topup"] => [{ "a" => -1000 }] + ["customerid_limit"] => [{ "a" => 1000 }], + ["customerid_low"] => [{ "a" => 1000 }], + ["customerid_topup"] => [{ "a" => 1000 }] ) ) Web.opts[:common_logger] = FakeLog.new