ruby on rails - Why is poltergeist firing a change event for an element that isn't on the tested page? -


i'm new poltergeist. decided use ability set cookies, have working fine. problem appears poltergeist running javascript code in entire rails project. feature test failing because poltergeist firing on change event, triggers ajax call, select tag doesn't appear on page being tested.

the test fails an:
actioncontroller::routingerror:
no route matches [get] "/users/ajax_sort"
happens, of course, because there not such route, nor should there be.

it appears poltergeist running @ least of code twice, evident because console.log logging twice.

any ideas why happening? or how fix it? seeing of code help?

thanks!

turns out jquery event binding problem. had as:
$(document).on('change', '#id_of_select', function()...
needed switch to:
$('#id_of_select).on('change', function()...


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

django - CSRF verification failed. Request aborted. CSRF cookie not set -

jsf - How to ajax update an item in the footer of a PrimeFaces dataTable? -