blob: f1139c626efb24f054768cb6b8f99e0631712bb6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
# frozen_string_literal: true
Then "I should see {int} options" do |number|
find("#poll_creator_container").all(".poll-answer", count: number)
end
And /^I delete the last option$/ do
find("#poll_creator_container").all(".poll-answer .remove-answer").first.click
end
And /^I should not see a remove icon$/ do
page.should_not have_css(".remove-answer")
end
When /^I fill in the following for the options:$/ do |table|
i = 0
table.raw.flatten.each do |value|
all(".poll-answer input")[i].native.send_keys(value)
i+=1
end
end
When /^I check the first option$/ do
page.should have_css(".poll-form input")
first(".poll-form input").click
end
When(/^I fill in values for the first two options$/) do
all(".poll-answer input").each_with_index do |answer, i|
answer.native.send_keys "answer option #{i}"
end
end
When(/^I lose focus$/) do
find("#poll_creator_container").click
end
Then /^I should see an element "([^"]*)"$/ do |selector|
page.should have_css(selector)
end
|