[#101] encapsulate some repeating code in search tests