I don't think it's necessary to test ride, but I find it helpful. When I got my Bianchi back in 2005, I test rode a Felt, a Fuji, and a Specialized as well, all within a few days of each other. Sure, none of the test rides was longer than 20 minutes, but it was enough to tell me that as-set-up by the shop, the Felt was ok, the Fuji was too aggressive, and the Specialized just failed to impress. Alternatively, I bonded with my Bianchi immediately.
For riders who are building frame-up, or willing to tinker with wheels, tires, stems, and saddles - a test ride may not provide that much information. For people who aren't going to be doing all of that (ie most), getting a test ride can definitely help weed out which setup you'll like better.