fix db/seeds.rb

This commit is contained in:
Fabián Rodríguez 2012-10-03 20:39:35 -03:00
parent a9bec8a4ee
commit ebd9f87e61

View file

@ -15,9 +15,9 @@ require 'factory_girl_rails'
require Rails.root.join('spec', 'helper_methods') require Rails.root.join('spec', 'helper_methods')
include HelperMethods include HelperMethods
alice = Factory(:user_with_aspect, :username => "alice", :password => 'evankorth') alice = FactoryGirl.create(:user_with_aspect, :username => "alice", :password => 'evankorth')
bob = Factory(:user_with_aspect, :username => "bob", :password => 'evankorth') bob = FactoryGirl.create(:user_with_aspect, :username => "bob", :password => 'evankorth')
eve = Factory(:user_with_aspect, :username => "eve", :password => 'evankorth') eve = FactoryGirl.create(:user_with_aspect, :username => "eve", :password => 'evankorth')
def url_hash(name) def url_hash(name)
image_url = "/assets/user/#{name}.jpg" image_url = "/assets/user/#{name}.jpg"
@ -41,8 +41,7 @@ connect_users(bob, bob.aspects.first, alice, alice.aspects.first)
connect_users(bob, bob.aspects.first, eve, eve.aspects.first) connect_users(bob, bob.aspects.first, eve, eve.aspects.first)
puts "done!" puts "done!"
print "making Bob an admin and beta... " print "making Bob an admin... "
Role.add_beta(bob.person)
Role.add_admin(bob.person) Role.add_admin(bob.person)
puts "done!" puts "done!"
@ -58,9 +57,9 @@ time_interval = 1000
if(n%3==1) if(n%3==1)
post = u.post :status_message, :text => "#{u.username} - #{n} - #seeded", :to => u.aspects.first.id post = u.post :status_message, :text => "#{u.username} - #{n} - #seeded", :to => u.aspects.first.id
elsif(n%3==2) elsif(n%3==2)
post =u.post(:reshare, :root_guid => Factory(:status_message, :public => true).guid, :to => 'all') post = u.post(:reshare, :root_guid => FactoryGirl.create(:status_message, :public => true).guid, :to => 'all')
else else
post = Factory(:activity_streams_photo, :public => true, :author => u.person) post = FactoryGirl.create(:activity_streams_photo, :public => true, :author => u.person)
u.add_to_streams(post, u.aspects) u.add_to_streams(post, u.aspects)
end end