mirror of
https://github.com/discourse/discourse.git
synced 2025-06-04 21:26:02 +08:00
REFACTOR: remove hacky search from discovery
This commit is contained in:
@ -48,28 +48,10 @@ describe TopicQuery do
|
||||
|
||||
expect(TopicQuery.new(nil).list_topics_by(user).topics.count).to eq(1)
|
||||
expect(TopicQuery.new(user).list_topics_by(user).topics.count).to eq(2)
|
||||
|
||||
# search should return nothing normally
|
||||
expect(TopicQuery.new(nil).list_search.topics.count).to eq(0)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
context 'search' do
|
||||
it 'can correctly search' do
|
||||
# got to enable indexing
|
||||
ActiveRecord::Base.observers.enable :all
|
||||
|
||||
p = create_post(raw: "I am super awesome and search will find me")
|
||||
create_post(topic_id: p.topic_id, raw: "I am super spectacular post of doom")
|
||||
|
||||
results = TopicQuery.new(nil, q: "doom").list_search
|
||||
|
||||
expect(results.topics.count).to eq(1)
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
context 'bookmarks' do
|
||||
it "filters and returns bookmarks correctly" do
|
||||
post = Fabricate(:post)
|
||||
|
Reference in New Issue
Block a user