I want to test the age of a user of my Rails application using cucumber. The feature definition look somewhat like following.
Scenario: Successful calculation of age
Given I set my date of birth to "1987-07-15"
Then my age should be "22"
Above feature definition will fail every year since the age of user will increase by one each year.
One solution could be to set the date of birth dynamically to something like 22.years.ago. But I do not know how to do this in Gherkin(cucumber feature definition language).
Any take on this?