Hi, I have to test one of my models, but it uses a seed database.

How do I delete everything on my database and create it again from seed
(default code for some examples) for every one of my unit tests?

Right now, when I run rake db:test:units (and if I put something on my code
like User.all.count) it says that there 2 users at the database (but with
nil paramters except id). If I do a setup code to create the new instances
at the database (as I want), it creates them, but there are still those 2
trash users there which makes my model not to work.

Thanks in advance

--
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@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 4 | next ›
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedJan 17, '12 at 3:05p
activeJan 17, '12 at 4:51p
posts4
users3
websiterubyonrails.org
irc#RubyOnRails

People

Translate

site design / logo © 2021 Grokbase