思维狮身人面像和功能测试存在问题
|
这是我的测试(与should助手一起使用):
context \"searching from header\" do
setup do
Factory(:city, :name => \'Testing It\')
ThinkingSphinx::Test.index \'city_core\', \'city_delta\'
ThinkingSphinx::Test.start
get :index,
:query => \'Testing It\'
end
should respond_with(:success)
should assign_to(:results)
should \"have one city on the result\" do
assert_equal( assigns(:results).count, 1 )
assert_kind_of( assigns(:results).first, City )
end
ThinkingSphinx::Test.stop
end
一切正常,除了测试总是说结果计数为0而不是1。
我已经调试了这段代码,并且当请求到达控制器时,Sphinx索引完全为空,即使对其有明确的索引调用也是如此。
我在这里做错什么了吗?
任何帮助表示赞赏。
没有找到相关结果
已邀请:
1 个回复
磐剩
希望这对遇到同样问题的人有所帮助。