aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/new_base/test_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test/new_base/test_helper.rb')
-rw-r--r--actionpack/test/new_base/test_helper.rb36
1 files changed, 36 insertions, 0 deletions
diff --git a/actionpack/test/new_base/test_helper.rb b/actionpack/test/new_base/test_helper.rb
index af790aa5dd..affb52a432 100644
--- a/actionpack/test/new_base/test_helper.rb
+++ b/actionpack/test/new_base/test_helper.rb
@@ -50,6 +50,42 @@ module ActionController
end
end
+module ActionView #:nodoc:
+ class FixtureTemplate < Template
+ class FixturePath < Template::Path
+ def initialize(hash)
+ @hash = {}
+
+ hash.each do |k, v|
+ @hash[k.sub(/\.\w+$/, '')] = FixtureTemplate.new(v, k.split("/").last, self)
+ end
+
+ super("")
+ end
+
+ def find_template(path)
+ @hash[path]
+ end
+ end
+
+ def initialize(body, *args)
+ @body = body
+ super(*args)
+ end
+
+ def source
+ @body
+ end
+
+ private
+
+ def find_full_path(path, load_paths)
+ return '/', path
+ end
+
+ end
+end
+
# Temporary base class
class Rack::TestCase < ActiveSupport::TestCase
include Rack::Test::Methods