错误capybara js:true

时间:2017-11-09 23:14:17

标签: ruby-on-rails capybara

当我尝试配置我的水豚测试以响应js时,我遇到了问题。这是我的考验:

test "creating_expense", js: true do
        visit expenses_path
        click_link('New Expense')

end

错误是: /var/lib/gems/2.3.0/gems/activesupport-5.0.6/lib/active_support/testing/declarative.rb:11:in`test':错误的参数个数(给定2,预期为1)(ArgumentError)

1 个答案:

答案 0 :(得分:0)

默认的最小[UIFont systemFontOfSize:32 weight:UIFontWeightBold] 方法不支持测试元数据(您正在复制的示例可能使用RSpec)。要交换到JS驱动程序,您需要更改设置博客中的test,如Capybara README中所示 - https://github.com/teamcapybara/capybara#using-capybara-with-minitest

如果您想在测试中添加元数据支持,可以查看最小的minidata gem - https://github.com/wojtekmach/minitest-metadata#example-with-capybara