test_bandwidth_tn_options.rb

 1# frozen_string_literal: true
 2
 3require "test_helper"
 4
 5class BandwidthTNOptionsTest < Minitest::Test
 6	CREDS = ['account_id', 'token', 'secret', '+15551234567'].freeze
 7
 8	def test_tn_eligible_for_port_out_pin_returns_false_on_404
 9		error = BandwidthIris::Errors::GenericError.new("404", "Not Found", 404)
10
11		with_stubs([
12			[BandwidthIris::Tn, :get, ->(_client, _tel) { raise error }]
13		]) do
14			result = BandwidthTNOptions.tn_eligible_for_port_out_pin?(CREDS).sync
15			refute result, "Expected false when TN returns 404"
16		end
17	end
18	em :test_tn_eligible_for_port_out_pin_returns_false_on_404
19end