@@ -48,9 +48,9 @@ class BandwidthTnRepo
def stash_for_later(tel, btn)
LOG.info "stash_for_later #{tel}\n#{caller}"
- details = btn.get_rate_center
+ details = btn.get_details
region = details[:state]
- locality = details[:rate_center]
+ locality = details[:city]
params = [tel, region, locality, CONFIG[:creds][:account]]
DB.exec(STASH_QUERY, params)
end
@@ -341,27 +341,24 @@ class AdminCommandTest < Minitest::Test
em :test_action_cancel_account
def test_action_cancel_account_keep_number
- rate_center_response = {
+ details_response = {
"TelephoneNumberDetails": {
State: "NY",
- RateCenter: "NWYRCYZN01"
+ City: "MANHATTEN"
}
}.to_xml(indent: 0, root: "TelephoneNumberResponse")
bandwidth_req = stub_request(
:get,
- "https://dashboard.bandwidth.com/v1.0/tns/5566667777/ratecenter"
- )
- .with(
- headers: {
- "Accept" => "application/xml",
- "Accept-Encoding" => "gzip, compressed",
- "Authorization" => "Basic dGVzdF9id191c2VyOnRlc3RfYndfcGFzc3dvcmQ=",
- "User-Agent" => "Ruby-Bandwidth-Iris"
- },
- body: ""
- )
- .to_return(status: 200, body: rate_center_response, headers: {})
+ "https://dashboard.bandwidth.com/v1.0/tns/5566667777/tndetails"
+ ).with(
+ headers: {
+ "Accept" => "application/xml",
+ "Accept-Encoding" => "gzip, compressed",
+ "Authorization" => "Basic dGVzdF9id191c2VyOnRlc3RfYndfcGFzc3dvcmQ=",
+ "User-Agent" => "Ruby-Bandwidth-Iris"
+ }
+ ).to_return(status: 200, body: details_response, headers: {})
churnbuster_req = stub_request(
:post,
@@ -385,7 +382,7 @@ class AdminCommandTest < Minitest::Test
sgx, admin = admin_command("+15566667777")
- sql_params = ["+15566667777", "NY", "NWYRCYZN01", "test_bw_account"]
+ sql_params = ["+15566667777", "NY", "MANHATTEN", "test_bw_account"]
BandwidthTnRepo::DB.expect(
:exec,