强制mobile_fu检测移动设备



有没有办法为我的应用程序的移动版本编写 rspec 测试?

我使用mobile_fu来检测呼叫是否来自移动设备。

但是现在 rspec 需要欺骗mobile_fu相信这是一个移动请求......

这篇文章对我来说是完美的解决方案。

您应该能够使用 RSpec 来驱动 Webrat,并设置 Webrat 用户代理来模拟移动设备:

http://robert-reiz.com/2012/02/27/integration-tests-with-rspec/

你来了 http://blog.sparqcode.com/2011/03/07/custom-user-agent-strings-with-cucumber-and-capybara/

最新更新