mirror of
https://github.com/codeninjasllc/discourse.git
synced 2025-02-17 04:01:29 -05:00
fix spec
This commit is contained in:
parent
30501e943c
commit
98d9f174ae
2 changed files with 3 additions and 3 deletions
|
@ -3,7 +3,7 @@ require_dependency 'search'
|
|||
class SearchController < ApplicationController
|
||||
|
||||
def query
|
||||
search_result = Search.query(params[:term], params[:type_filter], SiteSetting.min_search_term_length)
|
||||
search_result = Search.query(params[:term], current_user, params[:type_filter], SiteSetting.min_search_term_length)
|
||||
render_json_dump(search_result.as_json)
|
||||
end
|
||||
|
||||
|
|
|
@ -3,12 +3,12 @@ require 'spec_helper'
|
|||
describe SearchController do
|
||||
|
||||
it 'performs the query' do
|
||||
Search.expects(:query).with('test', nil, 3)
|
||||
Search.expects(:query).with('test', nil, nil, 3)
|
||||
xhr :get, :query, term: 'test'
|
||||
end
|
||||
|
||||
it 'performs the query with a filter' do
|
||||
Search.expects(:query).with('test', 'topic', 3)
|
||||
Search.expects(:query).with('test', nil, 'topic', 3)
|
||||
xhr :get, :query, term: 'test', type_filter: 'topic'
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue