我有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
有人可以告訴我如何解決這個問題。
你得到了什麼錯誤(以及場景的哪一步)? –