diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb index ae0f32379c6..4cdd4d2b6e7 100644 --- a/app/controllers/search_controller.rb +++ b/app/controllers/search_controller.rb @@ -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 diff --git a/spec/controllers/search_controller_spec.rb b/spec/controllers/search_controller_spec.rb index 8717590eeea..89df481e086 100644 --- a/spec/controllers/search_controller_spec.rb +++ b/spec/controllers/search_controller_spec.rb @@ -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