Skip to content

Instantly share code, notes, and snippets.

@artemave
Created October 21, 2011 11:33
Show Gist options
  • Save artemave/1303619 to your computer and use it in GitHub Desktop.
Save artemave/1303619 to your computer and use it in GitHub Desktop.
custom shoulda validate_inclusion_of matcher
RSpec::Matchers.define :validate_inclusion_of do |field, list|
match do |actual|
list.each do |i|
actual.should allow_value(i).for(field)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment