Skip to content

A platform for community discussion. Free, open, simple.

test: 💍 add test for thai tag

siriwatknp80b92cf469a0
diff --git a/spec/components/search_spec.rb b/spec/components/search_spec.rb
index c50037fe693..57d528e1aaf 100644
--- a/spec/components/search_spec.rb
+++ b/spec/components/search_spec.rb
@@ -1489,6 +1489,14 @@ describe Search do
expect(Search.execute('tags:さようなら').posts.map(&:id)).to eq([post.id])
end
+ it 'can find posts with thai tag' do
+ topic = Fabricate(:topic)
+ topic.tags = [Fabricate(:tag, name: 'เรซิ่น')]
+ post = Fabricate(:post, raw: 'Testing post', topic: topic)
+
+ expect(Search.execute('tags:เรซิ่น').posts.map(&:id)).to eq([post.id])
+ end
+
it 'can find posts with any tag from multiple tags' do
expect(Search.execute('tags:eggs,lunch').posts.map(&:id).sort).to eq([post1.id, post2.id, post3.id, post4.id, post5.id].sort)
end