I have the following test code:
assert_no_difference Avatar, :count do
a = create_avatar(:description => nil)
assert a.errors.on(:description)
end
further down, create_avatar looks like:
def create_avatar(options = {})
Avatar.create(:description => "Foo Descr.").merge(options)
end
(Borrowed from the user test in acts_as_auth...)
It seems to pass, as my avatar model has:
validates_presence_of :description written.
However, if say I try to force it to fail with assert_difference... it
still passes.
What did I miss?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---