2

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.

dax
  • 10,779
  • 8
  • 51
  • 86
nickcoxdotme
  • 6,567
  • 9
  • 46
  • 72

1 Answers1

0

Did you tried to take a screenshot? May be it will help to see what happened. https://github.com/jonleighton/poltergeist#taking-screenshots-with-some-extensions

woto
  • 2,893
  • 1
  • 29
  • 24