fixed tests

This commit is contained in:
albert
2011-10-16 01:40:42 -04:00
parent d2f2203c33
commit a7267cf00b
12 changed files with 141 additions and 30 deletions

View File

@@ -50,7 +50,7 @@ if Comment.count == 0
puts "Creating comments"
Post.all.each do |post|
rand(30).times do
Comment.create(:post_id => post.id, :body => rand(1_000_000).to_s)
Comment.create(:post_id => post.id, :body => Time.now.to_f.to_s)
end
end
else
@@ -61,7 +61,7 @@ if Note.count == 0
puts "Creating notes"
Post.all.each do |post|
rand(10).times do
note = Note.create(:post_id => post.id, :x => 0, :y => 0, :width => 100, :height => 100, :body => rand(1_000_000).to_s)
note = Note.create(:post_id => post.id, :x => 0, :y => 0, :width => 100, :height => 100, :body => Time.now.to_f.to_s)
rand(30).times do |i|
note.update_attributes(:body => (i * i).to_s)
@@ -106,7 +106,7 @@ if Pool.count == 0
1.upto(20) do |i|
pool = Pool.create(:name => i.to_s)
33.times do |j|
rand(33).times do |j|
pool.add!(Post.order("random()").first)
end
end
@@ -124,6 +124,18 @@ else
puts "Skipping favorites"
end
if ForumTopic.count == 0
puts "Creating forum posts"
100.times do |i|
topic = ForumTopic.create(:title => Time.now.to_f.to_s)
rand(100).times do |j|
post = ForumPost.create(:topic_id => topic.id, :body => Time.now.to_f.to_s)
end
end
end
if TagSubscription.count == 0
puts "Creating tag subscriptions"
TagSubscription.create(:name => "0", :tag_query => Tag.order("random()").first.name)