Fix URL encoding in tests