mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-28 01:56:01 -05:00
b6bf95e741
correct group permission leaks add Discourse.cache for richer caching support
19 lines
465 B
Ruby
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
|