Expose which search strategy produced each result
query_packages now assigns @search_sources - a hash mapping package ids to the matching strategy that put them into the results: :exact, :name_prefix, :name_contains, :semantic or :fulltext. The grid and list views render a small badge with a humanized label per result, making the search tiers observable. semantic_results() was folded into search_packages() so each branch tags its own source. Adds the rails-controller-testing gem for assigns() in tests.
This commit is contained in:
parent
61b64fae25
commit
323b7004ed
6 changed files with 69 additions and 24 deletions
2
Gemfile
2
Gemfile
|
|
@ -108,6 +108,8 @@ group :test do
|
|||
# Use system testing [https://guides.rubyonrails.org/testing.html#system-testing]
|
||||
gem 'capybara'
|
||||
gem 'selenium-webdriver'
|
||||
# Provides the assigns() test helper extracted from modern Rails
|
||||
gem 'rails-controller-testing'
|
||||
end
|
||||
|
||||
# TODO… https://github.com/galetahub/simple-captcha
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue