discourse/spec/controllers/search_controller_spec.rb
Sam b6bf95e741 speed up startup (avoid loading some gems on startup)
correct group permission leaks
add Discourse.cache for richer caching support
2013-05-13 18:04:03 +10:00

19 lines
465 B
Ruby

require 'spec_helper'
describe SearchController do
it 'performs the query' do
m = Guardian.new(nil)
Guardian.stubs(:new).returns(m)
Search.expects(:query).with('test', m, nil, 3)
xhr :get, :query, term: 'test'
end
it 'performs the query with a filter' do
m = Guardian.new(nil)
Guardian.stubs(:new).returns(m)
Search.expects(:query).with('test', m, 'topic', 3)
xhr :get, :query, term: 'test', type_filter: 'topic'
end
end