Permalink
Browse files

basic federation profile testing stuff

  • Loading branch information...
1 parent 10a059e commit a81d1133cbb102f506009ecb97af97ba4ef3576c @maxwell maxwell committed Feb 14, 2012
View
@@ -0,0 +1,6 @@
+web1: env RAILS_ENV=integration1 bundle exec rails s -p 3001
+worker1: env RAILS_ENV=integration1 VVERBOSE=1 QUEUE=* bundle exec rake resque:work
+redis1: env RAILS_ENV=integration1 redis-server ./redis-integration1.conf
+web2: env RAILS_ENV=integration2 bundle exec rails s -p 3002
+worker2: env RAILS_ENV=integration2 VVERBOSE=1 QUEUE=* bundle exec rake resque:work
+redis2: env RAILS_ENV=integration2 redis-server ./redis-integration2.conf
@@ -24,9 +24,9 @@ class PublicsController < ApplicationController
respond_to :html
respond_to :xml, :only => :post
+ caches_page :host_meta, :if => Proc.new{ Rails.env == 'production'}
layout false
- caches_page :host_meta
def hcard
@person = Person.find_by_guid_and_closed_account(params[:guid], false)
@@ -53,6 +53,11 @@ def create
receiving_services = Service.titles(services)
current_user.dispatch_post(@status_message, :url => short_post_url(@status_message.guid), :service_types => receiving_services)
+
+ @status_message.photos.each do |photo|
+ current_user.dispatch_post(photo)
+ end
+
current_user.participate!(@status_message)
if coming_from_profile_page? # if this is a post coming from a profile page
@@ -26,11 +26,15 @@ common: &common
development:
<<: *common
database: diaspora_development
-
production:
<<: *common
database: diaspora_production
-
test:
<<: *common
database: "diaspora_test<%= ENV['TEST_ENV_NUMBER'] %>"
+integration1:
+ <<: *common
+ database: diaspora_integration1
+integration2:
+ <<: *common
+ database: diaspora_integration2
@@ -8,6 +8,8 @@
Resque.redis = Redis.new(:host => uri.host, :port => uri.port, :password => uri.password)
elsif AppConfig[:redis_url]
Resque.redis = Redis.new(:host => AppConfig[:redis_url], :port => 6379)
+ elsif ENV['RAILS_ENV']== 'integration2'
+ Resque.redis = Redis.new(:host => 'localhost', :port => 6380)
end
end
View
@@ -20,12 +20,14 @@ namespace :db do
task :prepare => :environment do
abcs = ActiveRecord::Base.configurations
envs = abcs.keys.select{ |k| k.include?("integration") }
+ puts envs.inspect
envs.each do |env|
- ActiveRecord::Base.establish_connection(env)
- ActiveRecord::Base.connection.drop_database(abcs[env]["database"])
- ActiveRecord::Base.connection.create_database(abcs[env]["database"])
- ActiveRecord::Base.establish_connection(env)
- ActiveRecord::Migrator.migrate("db/migrate", nil)
+ puts "dropping #{env}..."
+ `cd #{Rails.root} && RAILS_ENV=#{env} bundle exec rake db:drop`
+ puts "creating #{env}..."
+ `cd #{Rails.root} && RAILS_ENV=#{env} bundle exec rake db:create`
+ puts "migrating #{env}..."
+ `cd #{Rails.root} && RAILS_ENV=#{env} bundle exec rake db:migrate`
end
end
end
Oops, something went wrong.

0 comments on commit a81d113

Please sign in to comment.