小编Don*_*cci的帖子

如何检查rails功能测试中是否显示文本?

我目前正在为我的控制器编写功能测试,我想检查是否有线路

这是一条测试线

出现在我的页面上.

我试过用

assert_select "p" do
  assert_select "this is the test line"
end
Run Code Online (Sandbox Code Playgroud)

但我觉得这条线路有问题.

在rails 3版本中执行此操作的最佳方法是什么?

testing ruby-on-rails functional-testing

4
推荐指数
2
解决办法
2624
查看次数