Though Imam Ali (as), having the intention of going to Kufa, had to take a different path, he accompanied his fellow non-Muslim traveler.
Once a non-Muslim and Imam Ali (as) happened to become fellow travelers along the way to their destinations. The Non-Muslim asked Imam Ali (as): "Where are you going?" The Imam (as) said, "I am going to Kufa."
They travelled together and came to a juncture where they had to depart and each take a different path. The Imam (as), instead of taking the way to Kufa, kept accompanying the non-Muslim. Surprised, the man asked, "Didn’t you want to go to Kufah?"
"Yes, I did." Said the Imam (as). "Then, why did you come this way and did not take the way to Kufa?" inquired the man.
The imam (as) said, "I know this is not the way to Kufa, but our Prophet (pbuh&hf) advised us to accompany our fellow traveler for some steps." Impressed, the man asked, "Did your prophet really say so?" The Imam (as) said, "Yes, he did."
The man said, "Whosoever became a follower of your Prophet, did so because of your Prophet's benevolent behavior. I take you as witness that from now on I am the follower of your religion." Thus, he became a Muslim.
Reference: Bihar al-Anwar, vol. 41, p. 153.