Capybara click on link which executes js doesn't working
<p>I have this code while using Capybara:</p>

<pre><code>a = page.find(".show-link")
a.click
expect(page).not_to have_css(".someClass.hidden")
</code></pre>

<p>And I have link</p>

<pre><code>&lt;a class="show-link" href=""&gt;Show me!&lt;/a&gt;
</code></pre>

<p>I have also js function bind to click event which removes hidden class from element:</p>

<pre><code>$("body").on("click", ".show-link",function(){$('.someClass').removeClass('hidden');return false;});
</code></pre>

<p>But instead of executing my js function on click I get redirected to another page.</p>

<p>I tried to set <code>href = "#"</code>, I tried to change <code>&lt;a&gt;</code> to <code>&lt;span&gt;</code> but doesn't work
script is not executed.</p>