预计会找到可见的CSS XXX,但没有匹配项。还发现“”,它与选择器匹配,但与RSPEC中的所有过滤器都不匹配

时间:2018-10-29 17:10:49

标签: ruby-on-rails rspec rspec-rails

RSpec::Expectations::ExpectationNotMetError: expected to find visible css "input#payment_plan_plan1" but there were no matches. Also found "", which matched the selector but not all filters.

如果在RSPEC中对以下字符执行have_selector,将输出上述错误

rails控制台:

kk = "<input type=\"hidden\" name=\"payment_plan\" id=\"payment_plan_plan1\" value=\"plan1\" />"
expect(kk).to have_selector "input#payment_plan_plan1"

让我知道为什么以上命令无法执行。

※从Rails 5.16升级到5.2.1后,上述命令无法执行

感谢您阅读我的问题。

0 个答案:

没有答案