Skip to content

Instantly share code, notes, and snippets.

@iain
Created March 30, 2009 08:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iain/87691 to your computer and use it in GitHub Desktop.
Save iain/87691 to your computer and use it in GitHub Desktop.
Dutch version of default webrat steps
require File.expand_path(File.join(File.dirname(__FILE__), "..", "support", "paths"))
# Commonly used webrat steps
# http://github.com/brynary/webrat
# Dutch webrat steps translated by Iain
# http://iain.nl/
Stel /^ik ben op (.+)$/ do |page_name|
visit path_to(page_name)
end
Als /^ik naar (.+) ga$/ do |page_name|
visit path_to(page_name)
end
Als /^ik op "([^\"]*)" druk$/ do |button|
click_button(button)
end
Als /^ik op "([^\"]*)" klik$/ do |link|
click_link(link)
end
Als /^ik "([^\"]*)" invul bij het veld "([^\"]*)"$/ do |value, field|
fill_in(field, :with => value)
end
Als /^ik "([^\"]*)" selecteer van "([^\"]*)"$/ do |value, field|
select(value, :from => field)
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
# Als ik als datum en tijd "25 december 2008, 10:00" selecteer
Als /^ik als datum en tijd "([^\"]*)" selecteer$/ do |time|
select_datetime(time)
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" data and time
# And I select "November 25, 2004 10:30" as the "Alternative" data and time
# In Dutch
# Als ik "29 november 2009, 10:30" als datum en tijd selecteer voor "Voorkeursdatum"
Als /^ik "([^\"]*)" als datum en tijd selecter voor "([^\"]*)"$/ do |datetime, datetime_label|
select_datetime(datetime, :from => datetime_label)
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.
# In Dutch
# Als ik als tijd "14:30" selecteer
Als /^ik als tijd "([^\"]*)" selecteer$/ do |time|
select_time(time)
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
# In Dutch
# Als ik "14:30" als tijd selecteer voor "Startdatum"
Als /^ik "([^\"]*)" als tijd selecteer voor "([^\"]*)"$/ do |time, time_label|
select_time(time, :from => time_label)
end
# Use this step in conjunction with Rail's date_select helper. For example:
# When I select "February 20, 1981" as the date
# Als ik "29 november 1983" als datum selecteer
Als /^ik "([^\"]*)" als datum selecteer$/ do |date|
select_date(date)
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
# In Dutch
# Als ik "29 november 1983" als datum selecteer voor "geboortedatum"
Als /^ik "([^\"]*)" als datum selecteer voor "([^\"]*)"$/ do |date, date_label|
select_date(date, :from => date_label)
end
Als /^ik "([^\"]*)" aanvink$/ do |field|
check(field)
end
Als /^ik "([^\"]*)" uitvink$/ do |field|
uncheck(field)
end
Als /^ik "([^\"]*)" kies$/ do |field|
choose(field)
end
Als /^ik het bestand "([^\"]*)" toevoeg aan "([^\"]*)"$/ do |path, field|
attach_file(field, path)
end
# To be used with a table:
# Als ik deze waarden invul:
# | veld | waarde |
# | Naam | Iain |
# | E-mail | iain@iain.nl |
Als /^ik deze waarden invul:$/ do |table|
table.hashes.each do |hash|
fill_in hash[:veld], :with => hash[:waarde]
end
end
Dan /^zie ik "([^\"]*)"$/ do |text|
response.should contain(text)
end
Dan /^zie ik "([^\"]*)" niet$/ do |text|
response.should_not contain(text)
end
Dan /^is "([^\"]*)" aangevinkt$/ do |label|
field_labeled(label).should be_checked
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment