我正在使用 webrat 为 Rails 应用程序编写集成测试。填写表格后,用户按下提交并创建一个帐户。
click_button "Submit"
assert_contain "Your Account Has Been Created"
但是,测试失败:
expected the following element's content to include "Your Account Has Been Created":
You are being redirected.
<false> is not true.
通常要遵循重定向,我会使用 post_via_redirect,但是从 Webrat 的示例来看,click_button 后跟 assert_contain 应该可以工作
我刚开始使用 Webrat,所以我在这里遗漏了一些明显的东西吗?为什么我被重定向响应卡住了?
谢谢!
德布