太阳黑子和 RSpec 失败。提交似乎不起作用
我已经在 Rails 站点上使用 RSpec 运行了一些测试,但是尽管如此 按照说明操作,事情不太正常。
我通过 Factory 创建一篇文章,运行 Sunspot.commit,然后检查 结果。但我似乎总是一片空白。当我测试它时 通过控制台手动或通过网站它都可以找到 尽管。
有什么想法吗?如何输出太阳黑子日志以查看发生了什么?
我的 Gemfile 有以下内容,我正在运行 Rails 3.1.1
gem 'sunspot', '1.2.1'
gem 'sunspot_rails'
gem 'sunspot_test'
非常感谢, 格雷姆
I've got a few tests running with RSpec for a Rails site, but despite
following the instructions things aren't quite behaving themselves.
I create an article via a Factory, run Sunspot.commit and then check
the results. I always seem to draw a blank though. When I test it
manually via the console or through the website it all works find
though.
Any ideas? How can I output the sunspot logs to see what's going on?
My Gemfile has the following, and I'm running Rails 3.1.1
gem 'sunspot', '1.2.1'
gem 'sunspot_rails'
gem 'sunspot_test'
Many thanks,
Graeme
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是我没有正确阅读手册的错。
https://github.com/collectiveidea/sunspot_test/issues/9
有必要添加描述中的一个神奇位以确保 Solr 已启动。
这是 :search =>;确实如此,这很重要。
It was my fault for not reading the manual properly.
https://github.com/collectiveidea/sunspot_test/issues/9
It's necessary to add a magic bit to the description to make sure that Solr is started.
It's the :search => true that's important.
只是为了在上面的回复中添加一些内容;如果使用 FactoryGirl:
那么您不必在每个测试文件上添加提交调用...
Just to add a little something to the response above; if using FactoryGirl:
then you won't have to add the commit call on each test file...