language_test.rb
545 Bytes
require_relative "test_helper"
class LanguageTest < Minitest::Test
def setup
Song.destroy_all
end
def test_chinese
# requires https://github.com/medcl/elasticsearch-analysis-ik
skip unless ENV["CHINESE"]
with_options(Song, language: "chinese") do
store_names ["中华人民共和国国歌"], Song
assert_search "中华人民共和国", ["中华人民共和国国歌"], {}, Song
assert_search "国歌", ["中华人民共和国国歌"], {}, Song
assert_search "人", [], {}, Song
end
end
end