The regex - basically the whole test - is the same as in the form_builder_spec. The same goes for the User class. It's probably worth moving those common parts into the spec_helper.