rspec click a span
capybara, javascript, rspec, ruby-on-rails
Solution
You should be able to do
find('.feedbackLink').click
`find` returns an Element, and the Element class has a `#click` method.
Since you probably are handling the click in Javascript, don't forget to add `:js => true` as a metatag on your test.
Problem
I am using rspec to test some pages and would like to use the click method. However the DOM doesn't have the link or button. it's just a span and magically it becomes a link with javascript. ``` <span class="footerLink feedbackLink"> Feedback </span> ``` rspec offers "click_link" and "click_button" any ideas how I could click a span?