I have Konacha running with the Poltergeist driver in my config/initializers/konacha.rb
file. I've made sure that I set config.driver :poltergeist
in that file.
I'm having trouble getting Poltergeist to interact with the page. My test (toggler_spec.js
) is pretty simple:
describe 'Trip detail toggler', ->
describe 'clicking a show link', ->
it 'shows the trip description', ->
$('body').html(JST['templates/one_index_trip'])
$('.detail_toggle').click()
assert.isFalse $('.detail').hasClass 'hidden'
The template:
<div class="trip_links">
<a href="/trips/1" class="detail_toggle">Show Details</a>
<p class="detail hidden">This text should be hidden.</p>
</div>
And here's toggler.js.coffee
$('.detail_toggle').click ->
$(this).siblings('detail').removeClass 'hidden'
I've simplified it as much as possible.
Through logging, etc., I know that it's including the right files and everything, but Poltergeist won't click. I also tried $('.detail_toggle').trigger('click')
in my test, and that didn't work either. Thanks for any ideas you have.