I want to do something that I think should be quite simple but can't work it out. Using Cucumber and Capybara
In a table I want to click a button in the same row, but a different cell.
i.e. I want to find the button 'Change Role' that is in the same row as the name "Bob Perkins"
click_button "Change Role" within
I want to do something like
within find("td", text:"Bob Perkins").parent #where this would be the "tr" row
click_link_or_button("Change Role")
But that's giving me an ambigous match on "Change Role". Sure, there are more on the page, but only one of them is in the parent node of where it should be...