~singpolyma/sgx-jmp

d5ca7cfadb1903920f585f22f161c15ade24bda6 — Stephen Paul Weber 1 year, 10 months ago 2f5450c
Fix tests for sip account using APIError
2 files changed, 13 insertions(+), 2 deletions(-)

M lib/sip_account.rb
M test/test_customer.rb
M lib/sip_account.rb => lib/sip_account.rb +1 -0
@@ 4,6 4,7 @@ require "digest"
require "securerandom"
require "value_semantics/monkey_patched"

require_relative "bandwidth_iris_patch"
require_relative "mn_words"

class SipAccount

M test/test_customer.rb => test/test_customer.rb +12 -2
@@ 156,7 156,12 @@ class CustomerTest < Minitest::Test
			headers: {
				"Authorization" => "Basic Og=="
			}
		).to_return(status: 404)
		).to_return(
			status: 404,
			body:
				"<r><ResponseStatus><ErrorCode>0</ErrorCode>" \
				"<Description>desc</Description></ResponseStatus></r>"
		)
		sip = customer.sip_account
		assert_kind_of SipAccount::New, sip
		assert_equal "test", sip.username


@@ 191,7 196,12 @@ class CustomerTest < Minitest::Test
		stub_request(
			:get,
			"https://dashboard.bandwidth.com/v1.0/accounts//sipcredentials/test"
		).to_return(status: 404)
		).to_return(
			status: 404,
			body:
				"<r><ResponseStatus><ErrorCode>0</ErrorCode>" \
				"<Description>desc</Description></ResponseStatus></r>"
		)

		assert_equal "test", customer.sip_account.username
	end