diff options
Diffstat (limited to 'site/features/step_definitions/poll_steps.rb')
-rw-r--r-- | site/features/step_definitions/poll_steps.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/site/features/step_definitions/poll_steps.rb b/site/features/step_definitions/poll_steps.rb new file mode 100644 index 0000000..86a80ca --- /dev/null +++ b/site/features/step_definitions/poll_steps.rb @@ -0,0 +1,22 @@ +Then /^I should see suggested meeting times$/ do + descriptions = Agenda.current.agenda_items.first.voting_options.*.description + descriptions.each do |description| + Then "I should see \"#{description}\"" + end +end + +When /^I check some boxes$/ do + options = Agenda.current.agenda_items.first.voting_options + When "I check \"choice[#{options.first.id}]\"" + When "I check \"choice[#{options.last.id}]\"" +end + +Then /^I should see my times marked$/ do + options = Agenda.current.agenda_items.first.voting_options + "I should see checked checkbox with name \"#{options.first.id}\"" + "I should see checked checkbox with name \"#{options.last.id}\"" +end + +Then /^I should see checked checkbox with name "([^"]*)"$/ do |name| + page.should have_xpath(:xpath, "//input[@type='checkbox'][@name='#{"choice[#{no}]"}'][@checked]") +end |