diff --git a/Changelog.md b/Changelog.md index 572b065c3180ad370cd2d1c62005998fab7329cc..b8acc3c67410955045c405ffefb9de1d0f0837de 100644 --- a/Changelog.md +++ b/Changelog.md @@ -3,6 +3,7 @@ ## Refactor * Use Bootstrap modal for new aspect pane [#5850](https://github.com/diaspora/diaspora/pull/5850) * Use asset helper instead of .css.erb [#5886](https://github.com/diaspora/diaspora/pull/5886) +* Dropped db/seeds.rb [#5896](https://github.com/diaspora/diaspora/pull/5896) ## Bug fixes * Disable auto follow back on aspect deletion [#5846](https://github.com/diaspora/diaspora/pull/5846) diff --git a/db/seeds.rb b/db/seeds.rb deleted file mode 100644 index 64616f5fb0c7f664930f32214ae03c73beb18031..0000000000000000000000000000000000000000 --- a/db/seeds.rb +++ /dev/null @@ -1,72 +0,0 @@ -# Copyright (c) 2010-2011, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3 or later. See -# the COPYRIGHT file. - -# This file should contain all the record creation needed to seed the database with its default values. -# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup). -# -# Examples: -# -# cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }]) -# Mayor.create(:name => 'Daley', :city => citie - -require Rails.root.join('config', 'environment') -require 'factory_girl_rails' -require Rails.root.join('spec', 'helper_methods') -include HelperMethods - -alice = FactoryGirl.create(:user_with_aspect, :username => "alice", :password => 'evankorth') -bob = FactoryGirl.create(:user_with_aspect, :username => "bob", :password => 'evankorth') -eve = FactoryGirl.create(: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"}.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) -puts "done!" - -print "making Bob an admin... " -Role.add_admin(bob.person) -puts "done!" - - -require 'sidekiq/testing/inline' -require Rails.root.join('spec', 'support', 'user_methods') - -print "Seeding post data..." -time_interval = 1000 -(1..23).each do |n| - [alice, bob, eve].each do |u| - print '.' - if(n%2==0) - post = u.post :status_message, :text => "#{u.username} - #{n} - #seeded", :to => u.aspects.first.id - else - post = u.post(:reshare, :root_guid => FactoryGirl.create(:status_message, :public => true).guid, :to => 'all') - end - - post.created_at = post.created_at - time_interval - post.updated_at = post.updated_at - time_interval - post.save - time_interval += 1000 - end -end -puts " done!" - -puts "Successfully seeded the db with users eve, bob, and alice (password: 'evankorth')" -puts "" diff --git a/spec/helper_methods.rb b/spec/helper_methods.rb index 494f15407a27ce89eaa6c92d3042b96b6bc81704..e0df90faa383ff051a1e4ce1faa35c3a6ac14c04 100644 --- a/spec/helper_methods.rb +++ b/spec/helper_methods.rb @@ -1,3 +1,6 @@ + +require Rails.root.join("spec", "support", "inlined_jobs") + module HelperMethods def connect_users_with_aspects(u1, u2) aspect1 = u1.aspects.length == 1 ? u1.aspects.first : u1.aspects.where(:name => "Besties").first diff --git a/spec/support/user_methods.rb b/spec/support/user_methods.rb index 85f0068f7dba604f13b78a6f8910822616453fe3..3909c1645a275bc4a8fd0a519a232eb27db95027 100644 --- a/spec/support/user_methods.rb +++ b/spec/support/user_methods.rb @@ -17,7 +17,12 @@ class User self.aspects.reload add_to_streams(p, aspects) - dispatch_opts = {url: Rails.application.routes.url_helpers.post_url(p), to: opts[:to]} + dispatch_opts = { + url: Rails.application.routes.url_helpers.post_url( + p, + host: AppConfig.pod_uri.to_s + ), + to: opts[:to]} dispatch_opts.merge!(:additional_subscribers => p.root.author) if class_name == :reshare dispatch_post(p, dispatch_opts) end