Skip to content

Commit

Permalink
Remove unsupported steps for Capybara
Browse files Browse the repository at this point in the history
Capybara doesn't support the Rails specific
select_date, select_datetime etc..
  • Loading branch information
jnicklas committed Dec 14, 2009
1 parent 303775a commit 11e6614
Showing 1 changed file with 0 additions and 59 deletions.
Expand Up @@ -66,65 +66,6 @@ When /^(?:|I )select "([^\"]*)" from "([^\"]*)"(?: within "([^\"]*)")?$/ do |val
end
end

# Use this step in conjunction with Rail's datetime_select helper. For example:
# When I select "December 25, 2008 10:00" as the date and time
When /^(?:|I )select "([^\"]*)" as the date and time(?: within "([^\"]*)")?$/ do |time, selector|
with_scope(selector) do
select_datetime(time)
end
end

# Use this step when using multiple datetime_select helpers on a page or
# you want to specify which datetime to select. Given the following view:
# <%%= f.label :preferred %><br />
# <%%= f.datetime_select :preferred %>
# <%%= f.label :alternative %><br />
# <%%= f.datetime_select :alternative %>
# The following steps would fill out the form:
# When I select "November 23, 2004 11:20" as the "Preferred" date and time
# And I select "November 25, 2004 10:30" as the "Alternative" date and time
When /^(?:|I )select "([^\"]*)" as the "([^\"]*)" date and time(?: within "([^\"]*)")?$/ do |datetime, datetime_label, selector|
with_scope(selector) do
select_datetime(datetime, :from => datetime_label)
end
end

# Use this step in conjunction with Rail's time_select helper. For example:
# When I select "2:20PM" as the time
# Note: Rail's default time helper provides 24-hour time-- not 12 hour time. Webrat
# will convert the 2:20PM to 14:20 and then select it.
When /^(?:|I )select "([^\"]*)" as the time(?: within "([^\"]*)")?$/ do |time, selector|
with_scope(selector) do
select_time(time)
end
end

# Use this step when using multiple time_select helpers on a page or you want to
# specify the name of the time on the form. For example:
# When I select "7:30AM" as the "Gym" time
When /^(?:|I )select "([^\"]*)" as the "([^\"]*)" time(?: within "([^\"]*)")?$/ do |time, time_label, selector|
with_scope(selector) do
select_time(time, :from => time_label)
end
end

# Use this step in conjunction with Rail's date_select helper. For example:
# When I select "February 20, 1981" as the date
When /^(?:|I )select "([^\"]*)" as the date(?: within "([^\"]*)")?$/ do |date, selector|
with_scope(selector) do
select_date(date)
end
end

# Use this step when using multiple date_select helpers on one page or
# you want to specify the name of the date on the form. For example:
# When I select "April 26, 1982" as the "Date of Birth" date
When /^(?:|I )select "([^\"]*)" as the "([^\"]*)" date(?: within "([^\"]*)")?$/ do |date, date_label, selector|
with_scope(selector) do
select_date(date, :from => date_label)
end
end

When /^(?:|I )check "([^\"]*)"(?: within "([^\"]*)")?$/ do |field, selector|
with_scope(selector) do
check(field)
Expand Down

0 comments on commit 11e6614

Please sign in to comment.