# frozen_string_literal: true

require "test_helper"

class BandwidthTNOptionsTest < Minitest::Test
	CREDS = ['account_id', 'token', 'secret', '+15551234567'].freeze

	def test_tn_eligible_for_port_out_pin_returns_false_on_404
		error = BandwidthIris::Errors::GenericError.new("404", "Not Found", 404)

		with_stubs([
			[BandwidthIris::Tn, :get, ->(_client, _tel) { raise error }]
		]) do
			result = BandwidthTNOptions.tn_eligible_for_port_out_pin?(CREDS).sync
			refute result, "Expected false when TN returns 404"
		end
	end
	em :test_tn_eligible_for_port_out_pin_returns_false_on_404
end
