Include the search_log_id in search results

This commit is contained in:
Robin Ward
2017-07-17 11:57:13 -04:00
parent d0c5205a52
commit 21e02d6969
7 changed files with 74 additions and 8 deletions

View File

@ -57,8 +57,17 @@ describe SearchController do
it "logs the search term" do
SiteSetting.log_search_queries = true
xhr :get, :query, term: 'wookie'
expect(response).to be_success
expect(SearchLog.where(term: 'wookie')).to be_present
json = JSON.parse(response.body)
search_log_id = json['grouped_search_result']['search_log_id']
expect(search_log_id).to be_present
log = SearchLog.where(id: search_log_id).first
expect(log).to be_present
expect(log.term).to eq('wookie')
end
it "doesn't log when disabled" do