Skip to content

Instantly share code, notes, and snippets.

@jgagner
Created November 4, 2009 04:27
Show Gist options
  • Save jgagner/225777 to your computer and use it in GitHub Desktop.
Save jgagner/225777 to your computer and use it in GitHub Desktop.
Spec::Matchers.define :be_invalid_on do |field|
match do |model_instance|
!model_instance.valid? && model_instance.errors.on(field) != nil
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment