Mateusz Urbański
Mateusz Urbański

Reputation: 7862

Unused parameters passed to Capybara::Queries::SelectorQuery

I have spec like this:

  it 'contains Delete link' do
    expect(page).to have_link('Delete', admin_disease_path(disease))
  end

when I run specs it returns warning in the console:

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

How can I fix this?

Upvotes: 18

Views: 4607

Answers (1)

jfornoff
jfornoff

Reputation: 1368

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

From the documenting tests

Upvotes: 27

Related Questions