Skip to content

Instantly share code, notes, and snippets.

@wjdix
Created December 15, 2010 17:10
Show Gist options
  • Save wjdix/742274 to your computer and use it in GitHub Desktop.
Save wjdix/742274 to your computer and use it in GitHub Desktop.
Cucumber step to select dates
When /^I select "([^"]*)" as the "([^"]*)" date$/ do |date, field|
broken_date = date.split("/")
day = broken_date[1]
month = Date::MONTHNAMES[broken_date[0].to_i]
year = broken_date [2]
select year, :from => "#{field}_1i}"
select day, :from => "#{field}_2i}"
select month, :from => "#{field}_3i}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment