如何让devise_async使用Cucumber? [英] How do I get devise_async working with Cucumber?

查看:178
本文介绍了如何让devise_async使用Cucumber?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已按照README中的 devise_async 说明操作,而且我正在滚动Devise 2.1.2和delayed_job。在我的黄瓜测试中,我不再收到确认电子邮件,作为注册过程的一部分。作为测试的一部分,我应该做什么?我已经设置延迟工作,通过在我的测试环境中设置以下,跳过测试的实际延迟。

I've followed the instructions for devise_async as per the README and I'm rolling Devise 2.1.2 and delayed_job. In my cucumber tests, I no longer receive the confirmation email as part of the sign-up process. Is there something I should be doing as part of testing? I already set delayed job to skip the actual delay for testing by setting the following in my test environment.

Delayed::Worker.delay_jobs = false

但是即使设置为true,它仍然失败,虽然更慢。如果我删除devise_async宝石和相关行,一切都恢复生命。

But even with this set to true, it still fails, albeit more slowly. If I remove the devise_async gem and the relevant lines, everything bursts back into life.

谢谢,
Graeme

Thanks, Graeme

推荐答案

新版本的devise-async在记录提交到数据库后触发电子邮件。使用RSpec,默认情况下,每个测试都包含在事务中。黄瓜做同样吗?在这种情况下,您需要关闭这些测试事务。

The new version of devise-async triggers the emails after the record has been committed to the database. With RSpec, each test is wrapped in a transaction by default. Does Cucumber do the same? In that case you'll need to turn those test transactions off.

这里是我用于RSpec的:
http://www.denniskuczynski.com/2012/06 /22/changing-individual-test-configuration-based-on-passed-in-options.html

Here's what I use for RSpec: http://www.denniskuczynski.com/2012/06/22/changing-individual-test-configuration-based-on-passed-in-options.html

这篇关于如何让devise_async使用Cucumber?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆