9
我在我的网站的主页上使用ElasticSearch。在我的验收测试中,当用户登录时,他被重定向到主页。ElasticSearch +轮胎:模拟ES的好策略
但是在测试中使用ES代价昂贵(需要创建和删除索引),所以我不希望每次用户浏览主页时都必须这样做。
我想这样做的实际ES搜索仅在测试有一些元数据:
config.before(:each) do
if example.metadata[:elastic]
Model.create_elasticsearch_index
end
end
scenario "Results should be ordered by distance", :elastic do
# tests...
end
所以我需要在测试确实不具有“模拟”的搜索,而不是使用ES:弹性元数据。
什么是实现该目标的好方法?
谢谢,我会试试:) – Robin