0
我已经在我的Rails应用程序中添加了javascript,以便仅在其中一个复选框被选中时启用按钮。PhantomJS不适用于黄瓜测试
$(document).on('turbolinks:load', function() {
$(function() {
$('.delete-checkbox').change(function() {
if ($('.delete-checkbox:checked').length) {
$('#delete-url-btn').removeAttr('disabled');
} else {
$('#delete-url-btn').attr('disabled', 'disabled');
}
});
});
})
当我测试它时,代码在浏览器中肯定会起作用。但是,当我用poltergeist(phantomjs)运行我的黄瓜测试时,似乎没有找到javascript。我在我的黄瓜功能中添加了@javascript标记,并且我还按照phantomjs website上的所有说明添加了phantomjs。我想知道我失踪了什么?