Erik Lindblom
2011-May-04 18:24 UTC
[rspec-users] Best way to test validates_acceptance_of
Hello, I am trying to write a test to make sure that the property validates_acceptance_of is present on a model. In my exploration, I can''t seem to make a test that fails when this property is absent, then passes when added. Any guidance would be appreciated! ~Erik L. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20110504/9bcd62ad/attachment-0001.html>
David Chelimsky
2011-May-07 14:27 UTC
[rspec-users] Best way to test validates_acceptance_of
On May 4, 2011, at 1:24 PM, Erik Lindblom wrote:> Hello, > > I am trying to write a test to make sure that the property validates_acceptance_of is present on a model. In my exploration, I can''t seem to make a test that fails when this property is absent, then passes when added. > > Any guidance would be appreciated!Per http://stackoverflow.com/questions/5886961/best-way-to-test-validates-acceptance-of-with-rspec # Gemfile gem ''shoulda'', :group => :test # thing_spec.rb require ''spec_helper'' describe Thing do it { should validate_acceptance_of(:tos) } end