mirror of
https://github.com/discourse/discourse.git
synced 2025-02-07 20:08:26 +00:00
DEV: Add spec for searching for whisper posts.
This commit is contained in:
parent
f2342c2d32
commit
309e41d341
@ -395,7 +395,11 @@ describe Search do
|
|||||||
end
|
end
|
||||||
|
|
||||||
context 'posts' do
|
context 'posts' do
|
||||||
let(:post) { Fabricate(:post) }
|
fab!(:post) do
|
||||||
|
SearchIndexer.enable
|
||||||
|
Fabricate(:post)
|
||||||
|
end
|
||||||
|
|
||||||
let(:topic) { post.topic }
|
let(:topic) { post.topic }
|
||||||
|
|
||||||
let!(:reply) do
|
let!(:reply) do
|
||||||
@ -488,6 +492,18 @@ describe Search do
|
|||||||
ensure
|
ensure
|
||||||
Discourse.cache.clear
|
Discourse.cache.clear
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'allows staff to search for whispers' do
|
||||||
|
post.update!(post_type: Post.types[:whisper], raw: 'this is a tiger')
|
||||||
|
|
||||||
|
results = Search.execute('tiger')
|
||||||
|
|
||||||
|
expect(results.posts).to eq([])
|
||||||
|
|
||||||
|
results = Search.execute('tiger', guardian: Guardian.new(admin))
|
||||||
|
|
||||||
|
expect(results.posts).to eq([post])
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'topics' do
|
context 'topics' do
|
||||||
|
Loading…
x
Reference in New Issue
Block a user