Isolation tests intentionally avoid loading any state (because they're often testing things that have their own load path semantics that should not be polluted), so rack/test is not yet on the load path. Moving require "rack/test" into the setup means and after boot_rails means that it'll be required after the laod path has been altered to add in the Rails vendor/gems

This commit is contained in:
Carlhuda
2009-12-23 16:14:34 -08:00
parent 38aeb1528c
commit 83be262b4b

View File

@@ -1,18 +1,18 @@
require 'isolation/abstract_unit'
require 'rack/test'
module ApplicationTests
class RoutingTest < Test::Unit::TestCase
include ActiveSupport::Testing::Isolation
include Rack::Test::Methods
def setup
build_app
boot_rails
require 'rack/test'
extend Rack::Test::Methods
end
def app
@app ||= begin
boot_rails
require "#{app_path}/config/environment"
Rails.application