1

I just updated capybara and capybara-webkit from the master branch. I have restarted my spork server and now any time I call capybara methods (visit or click_link for example) I get an the above error saying 1 argument was passed but 0 were expected.

Given /^I have a posting$/ do
  visit "/postings"
  click_link "edit"
end

This happens with webkit and selenium.

Any ideas?

4

3 回答 3

2

Had same issue when updated capybara

Falling back to capybara v2.0.2 worked for me

于 2013-02-20T15:45:28.637 回答
1

This should be similar "Ambiguous matches" in find. You '/postings' page should have several "edit link"

Suggest to limit the result to first one, like this

find("a.edit-link:first").click

Ref: https://github.com/jnicklas/capybara/issues/658

于 2013-02-20T07:24:07.533 回答
0

In my case the problem was a wrong version of xpath. In the Gem file it was (1.0.0) and it should be (2.0.0).

Capibara was installed with bundle wich set it corr, but I copied a Gemfile.lock from another project which problably was using outdated versions of gems.

于 2014-03-13T13:49:48.703 回答