未使用的参数传递给Capybara :: Queries :: SelectorQuery

时间:2016-05-12 19:30:11

标签: ruby-on-rails ruby rspec capybara

我的规格是这样的:

Unused parameters passed to Capybara::Queries::SelectorQuery : ["/admin/diseases/913"]

当我运行规范时,它会在控制台中返回警告:

data = [1, 2, 3, 4, 5]

operations = {
    "+": lambda x,y: (value+y for value in x), 
    "-": lambda x,y: (value-y for value in x), 
    "*": lambda x,y: (value*y for value in x), 
    "/": lambda x,y: (value/y for value in x),
}

calculations = (
    (key, val, oper(data, val)) 
    for key, oper in sorted(operations.items()) 
    for val in data
)

我该如何解决这个问题?

1 个答案:

答案 0 :(得分:23)

expect(page).to have_link('Delete', href: admin_disease_path(disease))

来自documenting tests