Add and cleanup tests for search result pagination
fix #528; when per_page or sort values are changed, we should always reset the :page parameter to 1