aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2009-09-25 21:40:55 -0500
committerJoshua Peek <josh@joshpeek.com>2009-09-25 21:40:55 -0500
commitdfbd3b94094d54483a47faa9d927370df476f572 (patch)
treea51a222e698722ecb4a4618dd73a0b691ca0098d /railties/test
parentaccd9b4634f1a2f220bc3e38cf5c4add04186fe6 (diff)
downloadrails-dfbd3b94094d54483a47faa9d927370df476f572.tar.gz
rails-dfbd3b94094d54483a47faa9d927370df476f572.tar.bz2
rails-dfbd3b94094d54483a47faa9d927370df476f572.zip
Extract "parse_config" into AD
Diffstat (limited to 'railties/test')
-rw-r--r--railties/test/application/load_test.rb12
1 files changed, 9 insertions, 3 deletions
diff --git a/railties/test/application/load_test.rb b/railties/test/application/load_test.rb
index 6dda47bb8f..c5bc80197d 100644
--- a/railties/test/application/load_test.rb
+++ b/railties/test/application/load_test.rb
@@ -15,7 +15,13 @@ module ApplicationTests
end
test "running Rails::Application.load on the path returns a (vaguely) useful application" do
- @app = Rails::Application.load app_path
+ app_file "config.ru", <<-CONFIG
+ require File.dirname(__FILE__) + '/config/environment'
+ use Rails::Rack::Static
+ run ActionController::Dispatcher.new
+ CONFIG
+
+ @app = ActionDispatch::Utils.parse_config("#{app_path}/config.ru")
assert_welcome get("/")
end
@@ -37,7 +43,7 @@ module ApplicationTests
run proc {|env| [200, {"Content-Type" => "text/html"}, ["VICTORY"]] }
CONFIG
- @app = Rails::Application.load app_path, :config => "config.ru"
+ @app = ActionDispatch::Utils.parse_config("#{app_path}/config.ru")
assert_body "VICTORY", get("/omg")
assert_header "Config-Ru-Test", "TESTING", get("/omg")
@@ -48,7 +54,7 @@ module ApplicationTests
Myapp = proc {|env| [200, {"Content-Type" => "text/html"}, ["OMG ROBOTS"]] }
CONFIG
- @app = Rails::Application.load app_path, :config => "myapp.rb"
+ @app = ActionDispatch::Utils.parse_config("#{app_path}/myapp.rb")
assert_body "OMG ROBOTS", get("/omg")
end