我有2个下拉列表和第一个预先填充第二个下拉列表(这是在骨干中完成)的变化。更改事件没有得到触发与poltergeist
events: ->
'change #client_id': 'selectedClientChange'
selectedClientChange: (ev) ->
@populateGroups $(ev.target.selectedOptions).val()
与骚灵,但变化事件同一份书面水豚的规格是没有得到触发某些原因和规格是越来越失败。
scenario 'it should populate the groups automatically', js: true, speed: :slow do
click_link 'New Item'
find('#name').set('Sample Item')
page.execute_script("$('#client_id').val('testing').trigger('change')")
select "#{client.name}", from: "client_id"
groups = find('#group_id').all('option').collect(&:text)
expect(groups.count).to eq 1
expect(groups).to include pg.name
end
有人可以告诉我如何解决这个问题。
你得到了什么错误(以及场景的哪一步)? –