Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/diaspora/diaspora.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorRaphael Sofaer <raphael@joindiaspora.com>2011-07-20 13:20:23 +0400
committerRaphael Sofaer <raphael@joindiaspora.com>2011-07-22 05:23:33 +0400
commite19fb6d0f885afaaaa48708da2f29f60ecfc2bed (patch)
treebbe5ebe8c96960081ff22e9e642a895f69e7f2a2 /spec
parent537766d0d70ee26b5fce3a770062f15f66e0f790 (diff)
Use authority instead of host in order to get the port as well.
Diffstat (limited to 'spec')
-rw-r--r--spec/support/server.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/spec/support/server.rb b/spec/support/server.rb
index eb31db5e6..27df791f7 100644
--- a/spec/support/server.rb
+++ b/spec/support/server.rb
@@ -9,7 +9,7 @@ class Server
attr_reader :port, :env
def initialize(env)
@db_config = ActiveRecord::Base.configurations[env]
- @app_config = (YAML.load_file AppConfig.source)[env]
+ @app_config = (YAML.load_file AppConfig.source)[env]
@port = URI::parse(@app_config["pod_url"]).port
@env = env
ensure_database_setup
@@ -18,7 +18,7 @@ class Server
def ensure_database_setup
`cd #{Rails.root} && RAILS_ENV=#{@env} bundle exec rake db:create`
tables_exist = self.db do
- ActiveRecord::Base.connection.tables.include?("users")
+ ActiveRecord::Base.connection.tables.include?("users")
end
if tables_exist
truncate_database
@@ -49,7 +49,7 @@ class Server
processes.first.split(" ").first
}.call
end
-
+
def running?
begin
RestClient.get("localhost:#{@port}/users/sign_in")
@@ -79,7 +79,7 @@ class Server
def in_scope
pod_url = "http://localhost:#{@port}/"
AppConfig.stub!(:pod_url).and_return(pod_url)
- AppConfig.stub!(:pod_uri).and_return(URI.parse(pod_url))
+ AppConfig.stub!(:pod_uri).and_return(Addressable::URI.parse(pod_url))
begin
result = db do
yield