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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With