From db9eb85c02cfe98713783886acc85949bb49b22f Mon Sep 17 00:00:00 2001 From: Jamis Buck Date: Wed, 24 Jun 2026 13:44:07 -0600 Subject: [PATCH] fix test for server 9.0 --- spec/integration/auth_spec.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/spec/integration/auth_spec.rb b/spec/integration/auth_spec.rb index d9fb6d3b1f..54929c4b69 100644 --- a/spec/integration/auth_spec.rb +++ b/spec/integration/auth_spec.rb @@ -43,12 +43,13 @@ end # An existing user will negotiate scram-sha-256. - # A non-existing user negotiate scram-sha-1. - it 'indicates scram-sha-1 was used' do + # A non-existing user will negotiate scram-sha-1 or scram-sha-256 + # depending on the server version. + it 'raises an unauthorized error indicating scram was used' do expect do connection.connect! end.to raise_error(Mongo::Auth::Unauthorized, - /User nonexistent_user \(mechanism: scram\) is not authorized to access admin.*used mechanism: SCRAM-SHA-1/) + /User nonexistent_user \(mechanism: scram(256)?\) is not authorized to access admin.*used mechanism: SCRAM-SHA-(1|256)/) end end