Does RSpec automatically call #valid? on ActiveRecord models?

For instance, when this example is run:

it 'should reject a nil value' do
  @form = TimeShiftForm.new :file => nil

  puts "@form.errors.count = <<#...@form.errors.count}>>"
  @form.should have(1).error_on :file
  puts "@form.errors.count = <<#...@form.errors.count}>>"
end

This is printed:
@form.errors.count = <<0>>
@form.errors.count = <<1>>

However, I never called @form.valid? , which leads me to believe that RSpec called it for me.

If RSpec does in fact call #valid? automatically, should we refrain from manually calling #valid? ?
-Nick
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to