wiki pages: fix redirects to exact matches during search.
Change wiki page search to redirect to exact matches only when using the quick search bar. Fixes searches sometimes unexpectedly redirecting when doing a regular (non-quick) search that happens to return a single result. Also remove the logic that tries to expand the search when no results are found. This will eventually be replaced with a smarter "did you mean?" search.
This commit is contained in:
@@ -22,12 +22,14 @@ class WikiPagesControllerTest < ActionDispatch::IntegrationTest
|
||||
|
||||
should "list all wiki_pages (with search)" do
|
||||
get wiki_pages_path, params: {:search => {:title => "abc"}}
|
||||
assert_redirected_to(wiki_page_path(@wiki_page_abc))
|
||||
assert_response :success
|
||||
assert_select "tr td:first-child", text: "abc"
|
||||
end
|
||||
|
||||
should "list wiki_pages without tags with order=post_count" do
|
||||
get wiki_pages_path, params: {:search => {:title => "abc", :order => "post_count"}}
|
||||
assert_redirected_to(wiki_page_path(@wiki_page_abc))
|
||||
assert_response :success
|
||||
assert_select "tr td:first-child", text: "abc"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user