Fix tests

Stephen Paul Weber created

Change summary

lib/command_list.rb      | 3 +--
test/test_backend_sgx.rb | 6 ++----
2 files changed, 3 insertions(+), 6 deletions(-)

Detailed changes

lib/command_list.rb 🔗

@@ -19,10 +19,9 @@ class CommandList
 	end
 
 	def self.args_for(customer, from_jid)
-		registered = customer&.registered?
 		args = {
 			from_jid: from_jid, customer: customer,
-			tel: registered&.phone,
+			tel: customer&.registered? ? customer&.registered?&.phone : nil,
 			fwd: customer&.fwd, feature_flags: customer&.feature_flags || [],
 			payment_methods: [],
 			tn_portable: false

test/test_backend_sgx.rb 🔗

@@ -62,7 +62,6 @@ class BackendSgxTest < Minitest::Test
 
 	def test_set_port_out_pin_happy_path
 		sgx = TrivialBackendSgxRepo.new(redis: FakeRedis.new).get("test").sync
-		cust = customer("test", sgx: sgx)
 
 		port_out_pin = "74hwsn"
 		session_id = "session_yay_awesome"
@@ -104,7 +103,7 @@ class BackendSgxTest < Minitest::Test
 			end]
 		)
 
-		result = sgx.set_port_out_pin(cust, port_out_pin).sync
+		result = sgx.set_port_out_pin(port_out_pin).sync
 		assert_nil result
 		assert_mock BackendSgx::IQ_MANAGER
 	end
@@ -112,7 +111,6 @@ class BackendSgxTest < Minitest::Test
 
 	def test_set_port_out_pin_validation
 		sgx = TrivialBackendSgxRepo.new(redis: FakeRedis.new).get("test").sync
-		cust = customer("test", sgx: sgx)
 
 		[
 			["123", "PIN must be 4-10 alphanumeric characters"],
@@ -167,7 +165,7 @@ class BackendSgxTest < Minitest::Test
 			)
 
 			error = assert_raises(RuntimeError) {
-				sgx.set_port_out_pin(cust, invalid_pin).sync
+				sgx.set_port_out_pin(invalid_pin).sync
 			}
 
 			assert_equal expected_error, error.message