Created
December 15, 2010 17:10
-
-
Save wjdix/742274 to your computer and use it in GitHub Desktop.
Cucumber step to select dates
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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