I'm trying to introduce XPath to my Ruby on Rails, Cucumber and Capybara setup for the first time. My code
row_count_on_page = page.find(:xpath, "count(//table[@id='foo']/tbody/tr)")
undefined method `map' for 10.0:Float
Did you mean? tap (NoMethodError)
You should do the count outside the method.
As you are currently using, after the second member of find is evaluated you will have something like:
row_count_on_page = page.find(:xpath, "10.0")
which is not a valid xpath.