mardi 5 mai 2015

write rspec test based on age or date

I have a method that should return a category of member based on the age/date_of_birth. I want do write some test for that method because it a important method.

And my question is how can I test the model in order not failing the test in future because the date continuously changing.

I try to provide a pseudo test:

IF THE member IS > 18 => OUTPUT: "Adult"  
IF THE member IS < 15 => OUTPUT: "XYZ"

thanks

Aucun commentaire:

Enregistrer un commentaire