added favorite unit tests

This commit is contained in:
albert
2010-02-12 18:46:43 -05:00
parent b1c7fd04a8
commit 661c214094
7 changed files with 80 additions and 5 deletions

View File

@@ -3,6 +3,7 @@ class Pool < ActiveRecord::Base
validates_presence_of :name
validates_format_of :name, :with => /\A[^\s;,]+\Z/, :on => :create, :message => "cannot have whitespace, commas, or semicolons"
belongs_to :creator, :class_name => "User"
has_many :versions, :class_name => "PoolVersion"
def self.create_anonymous(creator)
pool = Pool.create(:name => "TEMP - #{Time.now.to_f}.#{rand(1_000_000)}", :creator => creator)