Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Generating specs based on the behaviour of your Rails application (airpair.com)
1 point by ndea on March 22, 2015 | hide | past | favorite | 1 comment


The goal is to generate regression tests which capture the behaviour of your rails application. Consider regression specs which capture your routes and give you feedback about non reachable routes. A further example where generated regression specs are useful are for inconsistent validations. Consider following validation:

validates :attribute, presence: true, allow_blank: true

A simple spec like:

it {is_expected.to validate_presence_of :attribute} would fail and give you feedback as a developer that your validation is invalid.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: