Unless it's one of our jids, is it really a customer?

Stephen Paul Weber created

Change summary

lib/customer_repo.rb       | 2 +-
test/test_customer_repo.rb | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)

Detailed changes

lib/customer_repo.rb 🔗

@@ -64,7 +64,7 @@ class CustomerRepo
 		Tel = Struct.new(:tel) do
 			def keys(redis)
 				redis.get("catapult_jid-#{tel}").then do |jid|
-					raise NotFound, "No jid" unless jid
+					raise NotFound, "No jid" unless jid.to_s =~ /\Acustomer_/
 
 					JID.for(jid).keys(redis, tel: tel)
 				end

test/test_customer_repo.rb 🔗

@@ -110,9 +110,9 @@ class CustomerRepoTest < Minitest::Test
 	em :test_find_sgx_customer_by_phone
 
 	def test_find_v2_customer_by_phone
-		customer = @repo.find_by_tel("+14445556666").sync
-		assert_kind_of Customer, customer
-		assert_equal "test_v2", customer.customer_id
+		assert_raises(CustomerRepo::NotFound) do
+			@repo.find_by_tel("+14445556666").sync
+		end
 	end
 	em :test_find_v2_customer_by_phone