Skip to content

Instantly share code, notes, and snippets.

@lporras
Forked from artemave/gist:1303619
Created June 5, 2012 21:54
Show Gist options
  • Save lporras/2878293 to your computer and use it in GitHub Desktop.
Save lporras/2878293 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