Skip to content

Commit

Permalink
update seeds.rb to reflect asset pipeline, and a lil bit of refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
maxwell committed Mar 31, 2012
1 parent 8e0998a commit 98b41d8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 17 deletions.
29 changes: 15 additions & 14 deletions db/seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,23 @@
bob = Factory(:user_with_aspect, :username => "bob", :password => 'evankorth')
eve = Factory(:user_with_aspect, :username => "eve", :password => 'evankorth')

def url_hash(name)
image_url = "/assets/user/#{name}jpg"
{
:image_url => image_url,
:image_url_small => image_url,
:image_url_medium => image_url
}
end


print "Creating seeded users... "
alice.person.profile.update_attributes(:first_name => "Alice", :last_name => "Smith",
:image_url => "/images/user/uma.jpg",
:image_url_small => "/images/user/uma.jpg",
:image_url_medium => "/images/user/uma.jpg")
bob.person.profile.update_attributes(:first_name => "Bob", :last_name => "Grimm",
:image_url => "/images/user/wolf.jpg",
:image_url_small => "/images/user/wolf.jpg",
:image_url_medium => "/images/user/wolf.jpg")
eve.person.profile.update_attributes(:first_name => "Eve", :last_name => "Doe",
:image_url => "/images/user/angela.jpg",
:image_url_small => "/images/user/angela.jpg",
:image_url_medium => "/images/user/angela.jpg")
alice.person.profile.update_attributes({:first_name => "Alice", :last_name => "Smith"}.merge(url_hash('uma')))
bob.person.profile.update_attributes({:first_name => "Bob", :last_name => "Grimm"}.merge(url_hash('wolf')))
eve.person.profile.update_attributes({:first_name => "Eve", :last_name => "Doe"}.merge(url_hash('angela')))
puts "done!"


print "Connecting users... "
connect_users(bob, bob.aspects.first, alice, alice.aspects.first)
connect_users(bob, bob.aspects.first, eve, eve.aspects.first)
Expand Down Expand Up @@ -79,5 +81,4 @@
puts " done!"

puts "Successfully seeded the db with users eve, bob, and alice (password: 'evankorth')"
puts ""

puts ""
6 changes: 3 additions & 3 deletions spec/factories.rb
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def r_str
sequence(:uid) { |id| "a#{id}"}
sequence(:name) { |num| "Rob Fergus the #{num.ordinalize}" }
association :service
photo_url "/images/user/adams.jpg"
photo_url "/assets/user/adams.jpg"
end

factory(:comment) do
Expand All @@ -170,7 +170,7 @@ def r_str

factory(:activity_streams_photo, :class => ActivityStreams::Photo) do
association(:author, :factory => :person)
image_url "#{AppConfig[:pod_url]}/images/asterisk.png"
image_url "#{AppConfig[:pod_url]}/assets/asterisk.png"
image_height 154
image_width 154
object_url "http://example.com/awesome_things.gif"
Expand All @@ -185,7 +185,7 @@ def r_str
sequence(:application_base_url) { |token| "http://chubbi#{token}.es/" }

description "The best way to chub on the ne"
icon_url "/images/chubbies48.png"
icon_url "/assets/chubbies48.png"
permissions_overview "I will use the permissions this way!"
sequence(:public_key) {|n| OpenSSL::PKey::RSA.new(2048) }
end
Expand Down

0 comments on commit 98b41d8

Please sign in to comment.