diff --git a/test/integration/mysql_integration_test.rb b/test/integration/mysql_integration_test.rb index de1ce75..335912e 100644 --- a/test/integration/mysql_integration_test.rb +++ b/test/integration/mysql_integration_test.rb @@ -106,7 +106,9 @@ class AfterPersistedTest < MySQLIntegrationTest end test "can't be used to inject SQL using .where" do - assert_raises MySQLBinUUID::InvalidUUID do + # In Rails 7.1, the gets wrapped in an ActiveRecord::StatementInvalid. + expected_error = ActiveRecord.version.to_s.start_with?("7.1") ? ActiveRecord::StatementInvalid : MySQLBinUUID::InvalidUUID + assert_raises(expected_error) do MyUuidModel.where(the_uuid: "' OR ''='").first end end