Changed test method to remove query string from path. 

The exec method removes the query string from the path if one exists, but the test method was not removing this query string. So if you end up with a path with a query string it would be fine when the exec method runs but when the test method runs it would return false. Removing the query string in both methods allows a route path like '/search/' to match '/search/?q=dog' correctly.