From 98d9f174aea298e67557c74a2127f4f3f60652f7 Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 13 May 2013 10:51:45 +1000 Subject: [PATCH] fix spec --- app/controllers/search_controller.rb | 2 +- spec/controllers/search_controller_spec.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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