Module: Capybara::ProposalsPicker

Includes:
DataPicker
Defined in:
decidim-proposals/lib/decidim/proposals/test/capybara_proposals_picker.rb

Instance Method Summary collapse

Methods included from DataPicker

#data_picker_choose_value, #data_picker_close, #data_picker_pick_current, #find_data_picker, #select_data_picker

Instance Method Details

#proposals_pick(proposals_picker, proposals) ⇒ Object


31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'decidim-proposals/lib/decidim/proposals/test/capybara_proposals_picker.rb', line 31

def proposals_pick(proposals_picker, proposals)
  data_picker = proposals_picker.data_picker

  expect(data_picker).to have_selector(".picker-prompt")
  data_picker.find(".picker-prompt").click

  proposals.each do |proposal|
    data_picker_choose_value(proposal.id)
  end
  data_picker_close

  expect(proposals_picker).to have_proposals_picked(proposals)
end