mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Add rspec test for searching posts with images.
This commit is contained in:
parent
23d67d2100
commit
8f7d81fde6
@ -1344,7 +1344,7 @@ en:
|
||||
seen: I've read
|
||||
unseen: I've not read
|
||||
wiki: are wiki
|
||||
images: includes image
|
||||
images: includes image(s)
|
||||
statuses:
|
||||
label: Where topics
|
||||
open: are open
|
||||
|
@ -628,6 +628,16 @@ describe Search do
|
||||
|
||||
end
|
||||
|
||||
it 'can find posts with images' do
|
||||
post_uploaded = Fabricate(:post_with_uploaded_image)
|
||||
post_with_image_urls = Fabricate(:post_with_image_urls)
|
||||
Fabricate(:post)
|
||||
TopicLink.extract_from(post_uploaded)
|
||||
TopicLink.extract_from(post_with_image_urls)
|
||||
|
||||
expect(Search.execute('in:image').posts.map(&:id).sort).to eq([post_uploaded.id, post_with_image_urls.id].sort)
|
||||
end
|
||||
|
||||
it 'can find by latest' do
|
||||
topic1 = Fabricate(:topic, title: 'I do not like that Sam I am')
|
||||
post1 = Fabricate(:post, topic: topic1)
|
||||
|
Loading…
Reference in New Issue
Block a user