}
+ end
+
+ def form_text(action = "/", id = nil, html_class = nil, remote = nil, multipart = nil, method = nil)
+ txt = %{"
+ end
+end
\ No newline at end of file
diff --git a/actionview/test/activerecord/polymorphic_routes_test.rb b/actionview/test/activerecord/polymorphic_routes_test.rb
new file mode 100644
index 0000000000..afb714484b
--- /dev/null
+++ b/actionview/test/activerecord/polymorphic_routes_test.rb
@@ -0,0 +1,546 @@
+require 'active_record_unit'
+require 'fixtures/project'
+
+class Task < ActiveRecord::Base
+ self.table_name = 'projects'
+end
+
+class Step < ActiveRecord::Base
+ self.table_name = 'projects'
+end
+
+class Bid < ActiveRecord::Base
+ self.table_name = 'projects'
+end
+
+class Tax < ActiveRecord::Base
+ self.table_name = 'projects'
+end
+
+class Fax < ActiveRecord::Base
+ self.table_name = 'projects'
+end
+
+class Series < ActiveRecord::Base
+ self.table_name = 'projects'
+end
+
+class ModelDelegator < ActiveRecord::Base
+ self.table_name = 'projects'
+
+ def to_model
+ ModelDelegate.new
+ end
+end
+
+class ModelDelegate
+ def self.model_name
+ ActiveModel::Name.new(self)
+ end
+
+ def to_param
+ 'overridden'
+ end
+end
+
+module Blog
+ class Post < ActiveRecord::Base
+ self.table_name = 'projects'
+ end
+
+ class Blog < ActiveRecord::Base
+ self.table_name = 'projects'
+ end
+
+ def self.use_relative_model_naming?
+ true
+ end
+end
+
+class PolymorphicRoutesTest < ActionController::TestCase
+ include SharedTestRoutes.url_helpers
+ self.default_url_options[:host] = 'example.com'
+
+ def setup
+ @project = Project.new
+ @task = Task.new
+ @step = Step.new
+ @bid = Bid.new
+ @tax = Tax.new
+ @fax = Fax.new
+ @delegator = ModelDelegator.new
+ @series = Series.new
+ @blog_post = Blog::Post.new
+ @blog_blog = Blog::Blog.new
+ end
+
+ def test_passing_routes_proxy
+ with_namespaced_routes(:blog) do
+ proxy = ActionDispatch::Routing::RoutesProxy.new(_routes, self)
+ @blog_post.save
+ assert_equal "http://example.com/posts/#{@blog_post.id}", polymorphic_url([proxy, @blog_post])
+ end
+ end
+
+ def test_namespaced_model
+ with_namespaced_routes(:blog) do
+ @blog_post.save
+ assert_equal "http://example.com/posts/#{@blog_post.id}", polymorphic_url(@blog_post)
+ end
+ end
+
+ def test_namespaced_model_with_name_the_same_as_namespace
+ with_namespaced_routes(:blog) do
+ @blog_blog.save
+ assert_equal "http://example.com/blogs/#{@blog_blog.id}", polymorphic_url(@blog_blog)
+ end
+ end
+
+ def test_namespaced_model_with_nested_resources
+ with_namespaced_routes(:blog) do
+ @blog_post.save
+ @blog_blog.save
+ assert_equal "http://example.com/blogs/#{@blog_blog.id}/posts/#{@blog_post.id}", polymorphic_url([@blog_blog, @blog_post])
+ end
+ end
+
+ def test_with_nil
+ with_test_routes do
+ assert_raise ArgumentError, "Nil location provided. Can't build URI." do
+ polymorphic_url(nil)
+ end
+ end
+ end
+
+ def test_with_record
+ with_test_routes do
+ @project.save
+ assert_equal "http://example.com/projects/#{@project.id}", polymorphic_url(@project)
+ end
+ end
+
+ def test_with_class
+ with_test_routes do
+ assert_equal "http://example.com/projects", polymorphic_url(@project.class)
+ end
+ end
+
+ def test_with_new_record
+ with_test_routes do
+ assert_equal "http://example.com/projects", polymorphic_url(@project)
+ end
+ end
+
+ def test_with_destroyed_record
+ with_test_routes do
+ @project.destroy
+ assert_equal "http://example.com/projects", polymorphic_url(@project)
+ end
+ end
+
+ def test_with_record_and_action
+ with_test_routes do
+ assert_equal "http://example.com/projects/new", polymorphic_url(@project, :action => 'new')
+ end
+ end
+
+ def test_url_helper_prefixed_with_new
+ with_test_routes do
+ assert_equal "http://example.com/projects/new", new_polymorphic_url(@project)
+ end
+ end
+
+ def test_url_helper_prefixed_with_edit
+ with_test_routes do
+ @project.save
+ assert_equal "http://example.com/projects/#{@project.id}/edit", edit_polymorphic_url(@project)
+ end
+ end
+
+ def test_url_helper_prefixed_with_edit_with_url_options
+ with_test_routes do
+ @project.save
+ assert_equal "http://example.com/projects/#{@project.id}/edit?param1=10", edit_polymorphic_url(@project, :param1 => '10')
+ end
+ end
+
+ def test_url_helper_with_url_options
+ with_test_routes do
+ @project.save
+ assert_equal "http://example.com/projects/#{@project.id}?param1=10", polymorphic_url(@project, :param1 => '10')
+ end
+ end
+
+ def test_format_option
+ with_test_routes do
+ @project.save
+ assert_equal "http://example.com/projects/#{@project.id}.pdf", polymorphic_url(@project, :format => :pdf)
+ end
+ end
+
+ def test_format_option_with_url_options
+ with_test_routes do
+ @project.save
+ assert_equal "http://example.com/projects/#{@project.id}.pdf?param1=10", polymorphic_url(@project, :format => :pdf, :param1 => '10')
+ end
+ end
+
+ def test_id_and_format_option
+ with_test_routes do
+ @project.save
+ assert_equal "http://example.com/projects/#{@project.id}.pdf", polymorphic_url(:id => @project, :format => :pdf)
+ end
+ end
+
+ def test_with_nested
+ with_test_routes do
+ @project.save
+ @task.save
+ assert_equal "http://example.com/projects/#{@project.id}/tasks/#{@task.id}", polymorphic_url([@project, @task])
+ end
+ end
+
+ def test_with_nested_unsaved
+ with_test_routes do
+ @project.save
+ assert_equal "http://example.com/projects/#{@project.id}/tasks", polymorphic_url([@project, @task])
+ end
+ end
+
+ def test_with_nested_destroyed
+ with_test_routes do
+ @project.save
+ @task.destroy
+ assert_equal "http://example.com/projects/#{@project.id}/tasks", polymorphic_url([@project, @task])
+ end
+ end
+
+ def test_with_nested_class
+ with_test_routes do
+ @project.save
+ assert_equal "http://example.com/projects/#{@project.id}/tasks", polymorphic_url([@project, @task.class])
+ end
+ end
+
+ def test_class_with_array_and_namespace
+ with_admin_test_routes do
+ assert_equal "http://example.com/admin/projects", polymorphic_url([:admin, @project.class])
+ end
+ end
+
+ def test_new_with_array_and_namespace
+ with_admin_test_routes do
+ assert_equal "http://example.com/admin/projects/new", polymorphic_url([:admin, @project], :action => 'new')
+ end
+ end
+
+ def test_unsaved_with_array_and_namespace
+ with_admin_test_routes do
+ assert_equal "http://example.com/admin/projects", polymorphic_url([:admin, @project])
+ end
+ end
+
+ def test_nested_unsaved_with_array_and_namespace
+ with_admin_test_routes do
+ @project.save
+ assert_equal "http://example.com/admin/projects/#{@project.id}/tasks", polymorphic_url([:admin, @project, @task])
+ end
+ end
+
+ def test_nested_with_array_and_namespace
+ with_admin_test_routes do
+ @project.save
+ @task.save
+ assert_equal "http://example.com/admin/projects/#{@project.id}/tasks/#{@task.id}", polymorphic_url([:admin, @project, @task])
+ end
+ end
+
+ def test_ordering_of_nesting_and_namespace
+ with_admin_and_site_test_routes do
+ @project.save
+ @task.save
+ @step.save
+ assert_equal "http://example.com/admin/projects/#{@project.id}/site/tasks/#{@task.id}/steps/#{@step.id}", polymorphic_url([:admin, @project, :site, @task, @step])
+ end
+ end
+
+ def test_nesting_with_array_ending_in_singleton_resource
+ with_test_routes do
+ @project.save
+ assert_equal "http://example.com/projects/#{@project.id}/bid", polymorphic_url([@project, :bid])
+ end
+ end
+
+ def test_nesting_with_array_containing_singleton_resource
+ with_test_routes do
+ @project.save
+ @task.save
+ assert_equal "http://example.com/projects/#{@project.id}/bid/tasks/#{@task.id}", polymorphic_url([@project, :bid, @task])
+ end
+ end
+
+ def test_nesting_with_array_containing_singleton_resource_and_format
+ with_test_routes do
+ @project.save
+ @task.save
+ assert_equal "http://example.com/projects/#{@project.id}/bid/tasks/#{@task.id}.pdf", polymorphic_url([@project, :bid, @task], :format => :pdf)
+ end
+ end
+
+ def test_nesting_with_array_containing_namespace_and_singleton_resource
+ with_admin_test_routes do
+ @project.save
+ @task.save
+ assert_equal "http://example.com/admin/projects/#{@project.id}/bid/tasks/#{@task.id}", polymorphic_url([:admin, @project, :bid, @task])
+ end
+ end
+
+ def test_nesting_with_array_containing_nil
+ with_test_routes do
+ @project.save
+ assert_equal "http://example.com/projects/#{@project.id}/bid", polymorphic_url([@project, nil, :bid])
+ end
+ end
+
+ def test_with_array_containing_single_object
+ with_test_routes do
+ @project.save
+ assert_equal "http://example.com/projects/#{@project.id}", polymorphic_url([nil, @project])
+ end
+ end
+
+ def test_with_array_containing_single_name
+ with_test_routes do
+ @project.save
+ assert_equal "http://example.com/projects", polymorphic_url([:projects])
+ end
+ end
+
+ def test_with_array_containing_symbols
+ with_test_routes do
+ assert_equal "http://example.com/series/new", polymorphic_url([:new, :series])
+ end
+ end
+
+ def test_with_hash
+ with_test_routes do
+ @project.save
+ assert_equal "http://example.com/projects/#{@project.id}", polymorphic_url(:id => @project)
+ end
+ end
+
+ def test_polymorphic_path_accepts_options
+ with_test_routes do
+ assert_equal "/projects/new", polymorphic_path(@project, :action => 'new')
+ end
+ end
+
+ def test_polymorphic_path_does_not_modify_arguments
+ with_admin_test_routes do
+ @project.save
+ @task.save
+
+ options = {}
+ object_array = [:admin, @project, @task]
+ original_args = [object_array.dup, options.dup]
+
+ assert_no_difference('object_array.size') { polymorphic_path(object_array, options) }
+ assert_equal original_args, [object_array, options]
+ end
+ end
+
+ # Tests for names where .plural.singular doesn't round-trip
+ def test_with_irregular_plural_record
+ with_test_routes do
+ @tax.save
+ assert_equal "http://example.com/taxes/#{@tax.id}", polymorphic_url(@tax)
+ end
+ end
+
+ def test_with_irregular_plural_class
+ with_test_routes do
+ assert_equal "http://example.com/taxes", polymorphic_url(@tax.class)
+ end
+ end
+
+ def test_with_irregular_plural_new_record
+ with_test_routes do
+ assert_equal "http://example.com/taxes", polymorphic_url(@tax)
+ end
+ end
+
+ def test_with_irregular_plural_destroyed_record
+ with_test_routes do
+ @tax.destroy
+ assert_equal "http://example.com/taxes", polymorphic_url(@tax)
+ end
+ end
+
+ def test_with_irregular_plural_record_and_action
+ with_test_routes do
+ assert_equal "http://example.com/taxes/new", polymorphic_url(@tax, :action => 'new')
+ end
+ end
+
+ def test_irregular_plural_url_helper_prefixed_with_new
+ with_test_routes do
+ assert_equal "http://example.com/taxes/new", new_polymorphic_url(@tax)
+ end
+ end
+
+ def test_irregular_plural_url_helper_prefixed_with_edit
+ with_test_routes do
+ @tax.save
+ assert_equal "http://example.com/taxes/#{@tax.id}/edit", edit_polymorphic_url(@tax)
+ end
+ end
+
+ def test_with_nested_irregular_plurals
+ with_test_routes do
+ @tax.save
+ @fax.save
+ assert_equal "http://example.com/taxes/#{@tax.id}/faxes/#{@fax.id}", polymorphic_url([@tax, @fax])
+ end
+ end
+
+ def test_with_nested_unsaved_irregular_plurals
+ with_test_routes do
+ @tax.save
+ assert_equal "http://example.com/taxes/#{@tax.id}/faxes", polymorphic_url([@tax, @fax])
+ end
+ end
+
+ def test_new_with_irregular_plural_array_and_namespace
+ with_admin_test_routes do
+ assert_equal "http://example.com/admin/taxes/new", polymorphic_url([:admin, @tax], :action => 'new')
+ end
+ end
+
+ def test_class_with_irregular_plural_array_and_namespace
+ with_admin_test_routes do
+ assert_equal "http://example.com/admin/taxes", polymorphic_url([:admin, @tax.class])
+ end
+ end
+
+ def test_unsaved_with_irregular_plural_array_and_namespace
+ with_admin_test_routes do
+ assert_equal "http://example.com/admin/taxes", polymorphic_url([:admin, @tax])
+ end
+ end
+
+ def test_nesting_with_irregular_plurals_and_array_ending_in_singleton_resource
+ with_test_routes do
+ @tax.save
+ assert_equal "http://example.com/taxes/#{@tax.id}/bid", polymorphic_url([@tax, :bid])
+ end
+ end
+
+ def test_with_array_containing_single_irregular_plural_object
+ with_test_routes do
+ @tax.save
+ assert_equal "http://example.com/taxes/#{@tax.id}", polymorphic_url([nil, @tax])
+ end
+ end
+
+ def test_with_array_containing_single_name_irregular_plural
+ with_test_routes do
+ @tax.save
+ assert_equal "http://example.com/taxes", polymorphic_url([:taxes])
+ end
+ end
+
+ # Tests for uncountable names
+ def test_uncountable_resource
+ with_test_routes do
+ @series.save
+ assert_equal "http://example.com/series/#{@series.id}", polymorphic_url(@series)
+ assert_equal "http://example.com/series", polymorphic_url(Series.new)
+ end
+ end
+
+ def test_routing_a_to_model_delegate
+ with_test_routes do
+ @delegator.save
+ assert_equal "http://example.com/model_delegates/overridden", polymorphic_url(@delegator)
+ end
+ end
+
+ def with_namespaced_routes(name)
+ with_routing do |set|
+ set.draw do
+ scope(:module => name) do
+ resources :blogs do
+ resources :posts
+ end
+ resources :posts
+ end
+ end
+
+ self.class.send(:include, @routes.url_helpers)
+ yield
+ end
+ end
+
+ def with_test_routes(options = {})
+ with_routing do |set|
+ set.draw do
+ resources :projects do
+ resources :tasks
+ resource :bid do
+ resources :tasks
+ end
+ end
+ resources :taxes do
+ resources :faxes
+ resource :bid
+ end
+ resources :series
+ resources :model_delegates
+ end
+
+ self.class.send(:include, @routes.url_helpers)
+ yield
+ end
+ end
+
+ def with_admin_test_routes(options = {})
+ with_routing do |set|
+ set.draw do
+ namespace :admin do
+ resources :projects do
+ resources :tasks
+ resource :bid do
+ resources :tasks
+ end
+ end
+ resources :taxes do
+ resources :faxes
+ end
+ resources :series
+ end
+ end
+
+ self.class.send(:include, @routes.url_helpers)
+ yield
+ end
+ end
+
+ def with_admin_and_site_test_routes(options = {})
+ with_routing do |set|
+ set.draw do
+ namespace :admin do
+ resources :projects do
+ namespace :site do
+ resources :tasks do
+ resources :steps
+ end
+ end
+ end
+ end
+ end
+
+ self.class.send(:include, @routes.url_helpers)
+ yield
+ end
+ end
+end
diff --git a/actionview/test/activerecord/render_partial_with_record_identification_test.rb b/actionview/test/activerecord/render_partial_with_record_identification_test.rb
new file mode 100644
index 0000000000..409370104d
--- /dev/null
+++ b/actionview/test/activerecord/render_partial_with_record_identification_test.rb
@@ -0,0 +1,210 @@
+require 'active_record_unit'
+
+class RenderPartialWithRecordIdentificationController < ActionController::Base
+ def render_with_has_many_and_belongs_to_association
+ @developer = Developer.find(1)
+ render :partial => @developer.projects
+ end
+
+ def render_with_has_many_association
+ @topic = Topic.find(1)
+ render :partial => @topic.replies
+ end
+
+ def render_with_scope
+ render :partial => Reply.base
+ end
+
+ def render_with_has_many_through_association
+ @developer = Developer.first
+ render :partial => @developer.topics
+ end
+
+ def render_with_has_one_association
+ @company = Company.find(1)
+ render :partial => @company.mascot
+ end
+
+ def render_with_belongs_to_association
+ @reply = Reply.find(1)
+ render :partial => @reply.topic
+ end
+
+ def render_with_record
+ @developer = Developer.first
+ render :partial => @developer
+ end
+
+ def render_with_record_collection
+ @developers = Developer.all
+ render :partial => @developers
+ end
+
+ def render_with_record_collection_and_spacer_template
+ @developer = Developer.find(1)
+ render :partial => @developer.projects, :spacer_template => 'test/partial_only'
+ end
+end
+
+class RenderPartialWithRecordIdentificationTest < ActiveRecordTestCase
+ tests RenderPartialWithRecordIdentificationController
+ fixtures :developers, :projects, :developers_projects, :topics, :replies, :companies, :mascots
+
+ def test_rendering_partial_with_has_many_and_belongs_to_association
+ get :render_with_has_many_and_belongs_to_association
+ assert_template 'projects/_project'
+ assert_equal assigns(:developer).projects.map(&:name).join, @response.body
+ end
+
+ def test_rendering_partial_with_has_many_association
+ get :render_with_has_many_association
+ assert_template 'replies/_reply'
+ assert_equal 'Birdman is better!', @response.body
+ end
+
+ def test_rendering_partial_with_scope
+ get :render_with_scope
+ assert_template 'replies/_reply'
+ assert_equal 'Birdman is better!Nuh uh!', @response.body
+ end
+
+ def test_render_with_record
+ get :render_with_record
+ assert_template 'developers/_developer'
+ assert_equal 'David', @response.body
+ end
+
+ def test_render_with_record_collection
+ get :render_with_record_collection
+ assert_template 'developers/_developer'
+ assert_equal 'DavidJamisfixture_3fixture_4fixture_5fixture_6fixture_7fixture_8fixture_9fixture_10Jamis', @response.body
+ end
+
+ def test_render_with_record_collection_and_spacer_template
+ get :render_with_record_collection_and_spacer_template
+ assert_equal assigns(:developer).projects.map(&:name).join('only partial'), @response.body
+ end
+
+ def test_rendering_partial_with_has_one_association
+ mascot = Company.find(1).mascot
+ get :render_with_has_one_association
+ assert_template 'mascots/_mascot'
+ assert_equal mascot.name, @response.body
+ end
+end
+
+class Game < Struct.new(:name, :id)
+ extend ActiveModel::Naming
+ include ActiveModel::Conversion
+ def to_param
+ id.to_s
+ end
+end
+
+module Fun
+ class NestedController < ActionController::Base
+ def render_with_record_in_nested_controller
+ render :partial => Game.new("Pong")
+ end
+
+ def render_with_record_collection_in_nested_controller
+ render :partial => [ Game.new("Pong"), Game.new("Tank") ]
+ end
+ end
+
+ module Serious
+ class NestedDeeperController < ActionController::Base
+ def render_with_record_in_deeper_nested_controller
+ render :partial => Game.new("Chess")
+ end
+
+ def render_with_record_collection_in_deeper_nested_controller
+ render :partial => [ Game.new("Chess"), Game.new("Sudoku"), Game.new("Solitaire") ]
+ end
+ end
+ end
+end
+
+class RenderPartialWithRecordIdentificationAndNestedControllersTest < ActiveRecordTestCase
+ tests Fun::NestedController
+
+ def test_render_with_record_in_nested_controller
+ get :render_with_record_in_nested_controller
+ assert_template %r{\Afun/games/_game\Z}
+ assert_equal "Fun Pong\n", @response.body
+ end
+
+ def test_render_with_record_collection_in_nested_controller
+ get :render_with_record_collection_in_nested_controller
+ assert_template %r{\Afun/games/_game\Z}
+ assert_equal "Fun Pong\nFun Tank\n", @response.body
+ end
+end
+
+class RenderPartialWithRecordIdentificationAndNestedControllersWithoutPrefixTest < ActiveRecordTestCase
+ tests Fun::NestedController
+
+ def test_render_with_record_in_nested_controller
+ old_config = ActionView::Base.prefix_partial_path_with_controller_namespace
+ ActionView::Base.prefix_partial_path_with_controller_namespace = false
+
+ get :render_with_record_in_nested_controller
+ assert_template %r{\Agames/_game\Z}
+ assert_equal "Just Pong\n", @response.body
+ ensure
+ ActionView::Base.prefix_partial_path_with_controller_namespace = old_config
+ end
+
+ def test_render_with_record_collection_in_nested_controller
+ old_config = ActionView::Base.prefix_partial_path_with_controller_namespace
+ ActionView::Base.prefix_partial_path_with_controller_namespace = false
+
+ get :render_with_record_collection_in_nested_controller
+ assert_template %r{\Agames/_game\Z}
+ assert_equal "Just Pong\nJust Tank\n", @response.body
+ ensure
+ ActionView::Base.prefix_partial_path_with_controller_namespace = old_config
+ end
+end
+
+class RenderPartialWithRecordIdentificationAndNestedDeeperControllersTest < ActiveRecordTestCase
+ tests Fun::Serious::NestedDeeperController
+
+ def test_render_with_record_in_deeper_nested_controller
+ get :render_with_record_in_deeper_nested_controller
+ assert_template %r{\Afun/serious/games/_game\Z}
+ assert_equal "Serious Chess\n", @response.body
+ end
+
+ def test_render_with_record_collection_in_deeper_nested_controller
+ get :render_with_record_collection_in_deeper_nested_controller
+ assert_template %r{\Afun/serious/games/_game\Z}
+ assert_equal "Serious Chess\nSerious Sudoku\nSerious Solitaire\n", @response.body
+ end
+end
+
+class RenderPartialWithRecordIdentificationAndNestedDeeperControllersWithoutPrefixTest < ActiveRecordTestCase
+ tests Fun::Serious::NestedDeeperController
+
+ def test_render_with_record_in_deeper_nested_controller
+ old_config = ActionView::Base.prefix_partial_path_with_controller_namespace
+ ActionView::Base.prefix_partial_path_with_controller_namespace = false
+
+ get :render_with_record_in_deeper_nested_controller
+ assert_template %r{\Agames/_game\Z}
+ assert_equal "Just Chess\n", @response.body
+ ensure
+ ActionView::Base.prefix_partial_path_with_controller_namespace = old_config
+ end
+
+ def test_render_with_record_collection_in_deeper_nested_controller
+ old_config = ActionView::Base.prefix_partial_path_with_controller_namespace
+ ActionView::Base.prefix_partial_path_with_controller_namespace = false
+
+ get :render_with_record_collection_in_deeper_nested_controller
+ assert_template %r{\Agames/_game\Z}
+ assert_equal "Just Chess\nJust Sudoku\nJust Solitaire\n", @response.body
+ ensure
+ ActionView::Base.prefix_partial_path_with_controller_namespace = old_config
+ end
+end
diff --git a/actionview/test/fixtures/_top_level_partial.html.erb b/actionview/test/fixtures/_top_level_partial.html.erb
new file mode 100644
index 0000000000..0b1c2e46e0
--- /dev/null
+++ b/actionview/test/fixtures/_top_level_partial.html.erb
@@ -0,0 +1 @@
+top level partial html
\ No newline at end of file
diff --git a/actionview/test/fixtures/_top_level_partial_only.erb b/actionview/test/fixtures/_top_level_partial_only.erb
new file mode 100644
index 0000000000..44f25b61d0
--- /dev/null
+++ b/actionview/test/fixtures/_top_level_partial_only.erb
@@ -0,0 +1 @@
+top level partial
\ No newline at end of file
diff --git a/actionview/test/fixtures/alternate_helpers/foo_helper.rb b/actionview/test/fixtures/alternate_helpers/foo_helper.rb
new file mode 100644
index 0000000000..2528584473
--- /dev/null
+++ b/actionview/test/fixtures/alternate_helpers/foo_helper.rb
@@ -0,0 +1,3 @@
+module FooHelper
+ redefine_method(:baz) {}
+end
diff --git a/actionview/test/fixtures/bad_customers/_bad_customer.html.erb b/actionview/test/fixtures/bad_customers/_bad_customer.html.erb
new file mode 100644
index 0000000000..d22af431ec
--- /dev/null
+++ b/actionview/test/fixtures/bad_customers/_bad_customer.html.erb
@@ -0,0 +1 @@
+<%= greeting %> bad customer: <%= bad_customer.name %><%= bad_customer_counter %>
\ No newline at end of file
diff --git a/actionview/test/fixtures/blog_public/.gitignore b/actionview/test/fixtures/blog_public/.gitignore
new file mode 100644
index 0000000000..312e635ee6
--- /dev/null
+++ b/actionview/test/fixtures/blog_public/.gitignore
@@ -0,0 +1 @@
+absolute/*
diff --git a/actionview/test/fixtures/blog_public/blog.html b/actionview/test/fixtures/blog_public/blog.html
new file mode 100644
index 0000000000..79ad44c010
--- /dev/null
+++ b/actionview/test/fixtures/blog_public/blog.html
@@ -0,0 +1 @@
+/blog/blog.html
\ No newline at end of file
diff --git a/actionview/test/fixtures/blog_public/index.html b/actionview/test/fixtures/blog_public/index.html
new file mode 100644
index 0000000000..2de3825481
--- /dev/null
+++ b/actionview/test/fixtures/blog_public/index.html
@@ -0,0 +1 @@
+/blog/index.html
\ No newline at end of file
diff --git a/actionview/test/fixtures/blog_public/subdir/index.html b/actionview/test/fixtures/blog_public/subdir/index.html
new file mode 100644
index 0000000000..517bded335
--- /dev/null
+++ b/actionview/test/fixtures/blog_public/subdir/index.html
@@ -0,0 +1 @@
+/blog/subdir/index.html
\ No newline at end of file
diff --git a/actionview/test/fixtures/comments/empty.de.html.erb b/actionview/test/fixtures/comments/empty.de.html.erb
new file mode 100644
index 0000000000..cffd90dd26
--- /dev/null
+++ b/actionview/test/fixtures/comments/empty.de.html.erb
@@ -0,0 +1 @@
+
Kein Kommentar
\ No newline at end of file
diff --git a/actionview/test/fixtures/comments/empty.html.builder b/actionview/test/fixtures/comments/empty.html.builder
new file mode 100644
index 0000000000..2b0c7207a3
--- /dev/null
+++ b/actionview/test/fixtures/comments/empty.html.builder
@@ -0,0 +1 @@
+xml.h1 'No Comment'
\ No newline at end of file
diff --git a/actionview/test/fixtures/comments/empty.html.erb b/actionview/test/fixtures/comments/empty.html.erb
new file mode 100644
index 0000000000..827f3861de
--- /dev/null
+++ b/actionview/test/fixtures/comments/empty.html.erb
@@ -0,0 +1 @@
+
No Comment
\ No newline at end of file
diff --git a/actionview/test/fixtures/comments/empty.xml.erb b/actionview/test/fixtures/comments/empty.xml.erb
new file mode 100644
index 0000000000..db1027cd7d
--- /dev/null
+++ b/actionview/test/fixtures/comments/empty.xml.erb
@@ -0,0 +1 @@
+No Comment
\ No newline at end of file
diff --git a/actionview/test/fixtures/companies.yml b/actionview/test/fixtures/companies.yml
new file mode 100644
index 0000000000..ed2992e0b1
--- /dev/null
+++ b/actionview/test/fixtures/companies.yml
@@ -0,0 +1,24 @@
+thirty_seven_signals:
+ id: 1
+ name: 37Signals
+ rating: 4
+
+TextDrive:
+ id: 2
+ name: TextDrive
+ rating: 4
+
+PlanetArgon:
+ id: 3
+ name: Planet Argon
+ rating: 4
+
+Google:
+ id: 4
+ name: Google
+ rating: 4
+
+Ionist:
+ id: 5
+ name: Ioni.st
+ rating: 4
\ No newline at end of file
diff --git a/actionview/test/fixtures/company.rb b/actionview/test/fixtures/company.rb
new file mode 100644
index 0000000000..f3ac3642fa
--- /dev/null
+++ b/actionview/test/fixtures/company.rb
@@ -0,0 +1,9 @@
+class Company < ActiveRecord::Base
+ has_one :mascot
+ self.sequence_name = :companies_nonstd_seq
+
+ validates_presence_of :name
+ def validate
+ errors.add('rating', 'rating should not be 2') if rating == 2
+ end
+end
diff --git a/actionview/test/fixtures/custom_pattern/another.html.erb b/actionview/test/fixtures/custom_pattern/another.html.erb
new file mode 100644
index 0000000000..6d7f3bafbb
--- /dev/null
+++ b/actionview/test/fixtures/custom_pattern/another.html.erb
@@ -0,0 +1 @@
+Hello custom patterns!
\ No newline at end of file
diff --git a/actionview/test/fixtures/custom_pattern/html/another.erb b/actionview/test/fixtures/custom_pattern/html/another.erb
new file mode 100644
index 0000000000..dbd7e96ab6
--- /dev/null
+++ b/actionview/test/fixtures/custom_pattern/html/another.erb
@@ -0,0 +1 @@
+Another template!
\ No newline at end of file
diff --git a/actionview/test/fixtures/custom_pattern/html/path.erb b/actionview/test/fixtures/custom_pattern/html/path.erb
new file mode 100644
index 0000000000..6d7f3bafbb
--- /dev/null
+++ b/actionview/test/fixtures/custom_pattern/html/path.erb
@@ -0,0 +1 @@
+Hello custom patterns!
\ No newline at end of file
diff --git a/actionview/test/fixtures/customers/_customer.html.erb b/actionview/test/fixtures/customers/_customer.html.erb
new file mode 100644
index 0000000000..483571e22a
--- /dev/null
+++ b/actionview/test/fixtures/customers/_customer.html.erb
@@ -0,0 +1 @@
+<%= greeting %>: <%= customer.name %>
\ No newline at end of file
diff --git a/actionview/test/fixtures/db_definitions/sqlite.sql b/actionview/test/fixtures/db_definitions/sqlite.sql
new file mode 100644
index 0000000000..99df4b3e61
--- /dev/null
+++ b/actionview/test/fixtures/db_definitions/sqlite.sql
@@ -0,0 +1,49 @@
+CREATE TABLE 'companies' (
+ 'id' INTEGER PRIMARY KEY NOT NULL,
+ 'name' TEXT DEFAULT NULL,
+ 'rating' INTEGER DEFAULT 1
+);
+
+CREATE TABLE 'replies' (
+ 'id' INTEGER PRIMARY KEY NOT NULL,
+ 'content' text,
+ 'created_at' datetime,
+ 'updated_at' datetime,
+ 'topic_id' integer,
+ 'developer_id' integer
+);
+
+CREATE TABLE 'topics' (
+ 'id' INTEGER PRIMARY KEY NOT NULL,
+ 'title' varchar(255),
+ 'subtitle' varchar(255),
+ 'content' text,
+ 'created_at' datetime,
+ 'updated_at' datetime
+);
+
+CREATE TABLE 'developers' (
+ 'id' INTEGER PRIMARY KEY NOT NULL,
+ 'name' TEXT DEFAULT NULL,
+ 'salary' INTEGER DEFAULT 70000,
+ 'created_at' DATETIME DEFAULT NULL,
+ 'updated_at' DATETIME DEFAULT NULL
+);
+
+CREATE TABLE 'projects' (
+ 'id' INTEGER PRIMARY KEY NOT NULL,
+ 'name' TEXT DEFAULT NULL
+);
+
+CREATE TABLE 'developers_projects' (
+ 'developer_id' INTEGER NOT NULL,
+ 'project_id' INTEGER NOT NULL,
+ 'joined_on' DATE DEFAULT NULL,
+ 'access_level' INTEGER DEFAULT 1
+);
+
+CREATE TABLE 'mascots' (
+ 'id' INTEGER PRIMARY KEY NOT NULL,
+ 'company_id' INTEGER NOT NULL,
+ 'name' TEXT DEFAULT NULL
+);
\ No newline at end of file
diff --git a/actionview/test/fixtures/developer.rb b/actionview/test/fixtures/developer.rb
new file mode 100644
index 0000000000..4941463015
--- /dev/null
+++ b/actionview/test/fixtures/developer.rb
@@ -0,0 +1,10 @@
+class Developer < ActiveRecord::Base
+ has_and_belongs_to_many :projects
+ has_many :replies
+ has_many :topics, :through => :replies
+ accepts_nested_attributes_for :projects
+end
+
+class DeVeLoPeR < ActiveRecord::Base
+ self.table_name = "developers"
+end
diff --git a/actionview/test/fixtures/developers.yml b/actionview/test/fixtures/developers.yml
new file mode 100644
index 0000000000..3656564f63
--- /dev/null
+++ b/actionview/test/fixtures/developers.yml
@@ -0,0 +1,21 @@
+david:
+ id: 1
+ name: David
+ salary: 80000
+
+jamis:
+ id: 2
+ name: Jamis
+ salary: 150000
+
+<% (3..10).each do |digit| %>
+dev_<%= digit %>:
+ id: <%= digit %>
+ name: fixture_<%= digit %>
+ salary: 100000
+<% end %>
+
+poor_jamis:
+ id: 11
+ name: Jamis
+ salary: 9000
\ No newline at end of file
diff --git a/actionview/test/fixtures/developers/_developer.erb b/actionview/test/fixtures/developers/_developer.erb
new file mode 100644
index 0000000000..904a3137e7
--- /dev/null
+++ b/actionview/test/fixtures/developers/_developer.erb
@@ -0,0 +1 @@
+<%= developer.name %>
\ No newline at end of file
diff --git a/actionview/test/fixtures/developers_projects.yml b/actionview/test/fixtures/developers_projects.yml
new file mode 100644
index 0000000000..cee359c7cf
--- /dev/null
+++ b/actionview/test/fixtures/developers_projects.yml
@@ -0,0 +1,13 @@
+david_action_controller:
+ developer_id: 1
+ project_id: 2
+ joined_on: 2004-10-10
+
+david_active_record:
+ developer_id: 1
+ project_id: 1
+ joined_on: 2004-10-10
+
+jamis_active_record:
+ developer_id: 2
+ project_id: 1
\ No newline at end of file
diff --git a/actionview/test/fixtures/digestor/comments/_comment.html.erb b/actionview/test/fixtures/digestor/comments/_comment.html.erb
new file mode 100644
index 0000000000..f172e749da
--- /dev/null
+++ b/actionview/test/fixtures/digestor/comments/_comment.html.erb
@@ -0,0 +1 @@
+Great story, bro!
diff --git a/actionview/test/fixtures/digestor/comments/_comments.html.erb b/actionview/test/fixtures/digestor/comments/_comments.html.erb
new file mode 100644
index 0000000000..c28646a283
--- /dev/null
+++ b/actionview/test/fixtures/digestor/comments/_comments.html.erb
@@ -0,0 +1 @@
+<%= render partial: "comments/comment", collection: commentable.comments %>
diff --git a/actionview/test/fixtures/digestor/events/_event.html.erb b/actionview/test/fixtures/digestor/events/_event.html.erb
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/actionview/test/fixtures/digestor/level/below/_header.html.erb b/actionview/test/fixtures/digestor/level/below/_header.html.erb
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/actionview/test/fixtures/digestor/level/below/index.html.erb b/actionview/test/fixtures/digestor/level/below/index.html.erb
new file mode 100644
index 0000000000..b92f49a8f8
--- /dev/null
+++ b/actionview/test/fixtures/digestor/level/below/index.html.erb
@@ -0,0 +1 @@
+<%= render partial: "header" %>
diff --git a/actionview/test/fixtures/digestor/messages/_form.html.erb b/actionview/test/fixtures/digestor/messages/_form.html.erb
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/actionview/test/fixtures/digestor/messages/_header.html.erb b/actionview/test/fixtures/digestor/messages/_header.html.erb
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/actionview/test/fixtures/digestor/messages/_message.html.erb b/actionview/test/fixtures/digestor/messages/_message.html.erb
new file mode 100644
index 0000000000..406a0fb848
--- /dev/null
+++ b/actionview/test/fixtures/digestor/messages/_message.html.erb
@@ -0,0 +1 @@
+THIS BE WHERE THEM MESSAGE GO, YO!
\ No newline at end of file
diff --git a/actionview/test/fixtures/digestor/messages/actions/_move.html.erb b/actionview/test/fixtures/digestor/messages/actions/_move.html.erb
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/actionview/test/fixtures/digestor/messages/edit.html.erb b/actionview/test/fixtures/digestor/messages/edit.html.erb
new file mode 100644
index 0000000000..a9e0a88e32
--- /dev/null
+++ b/actionview/test/fixtures/digestor/messages/edit.html.erb
@@ -0,0 +1,5 @@
+<%= render "header" %>
+<%= render partial: "form" %>
+<%= render @message %>
+<%= render ( @message.events ) %>
+<%= render :partial => "comments/comment", :collection => @message.comments %>
diff --git a/actionview/test/fixtures/digestor/messages/index.html.erb b/actionview/test/fixtures/digestor/messages/index.html.erb
new file mode 100644
index 0000000000..1937b652e4
--- /dev/null
+++ b/actionview/test/fixtures/digestor/messages/index.html.erb
@@ -0,0 +1,2 @@
+<%= render @messages %>
+<%= render @events %>
diff --git a/actionview/test/fixtures/digestor/messages/show.html.erb b/actionview/test/fixtures/digestor/messages/show.html.erb
new file mode 100644
index 0000000000..51b3b61e8e
--- /dev/null
+++ b/actionview/test/fixtures/digestor/messages/show.html.erb
@@ -0,0 +1,13 @@
+<%# Template Dependency: messages/message %>
+<%= render "header" %>
+<%= render "comments/comments" %>
+
+<%= render "messages/actions/move" %>
+
+<%= render @message.history.events %>
+
+<%# render "something_missing" %>
+
+<%
+ # Template Dependency: messages/form
+%>
\ No newline at end of file
diff --git a/actionview/test/fixtures/filter_test/implicit_actions/edit.html.erb b/actionview/test/fixtures/filter_test/implicit_actions/edit.html.erb
new file mode 100644
index 0000000000..8491ab9f80
--- /dev/null
+++ b/actionview/test/fixtures/filter_test/implicit_actions/edit.html.erb
@@ -0,0 +1 @@
+edit
\ No newline at end of file
diff --git a/actionview/test/fixtures/filter_test/implicit_actions/show.html.erb b/actionview/test/fixtures/filter_test/implicit_actions/show.html.erb
new file mode 100644
index 0000000000..0a89cecf05
--- /dev/null
+++ b/actionview/test/fixtures/filter_test/implicit_actions/show.html.erb
@@ -0,0 +1 @@
+show
\ No newline at end of file
diff --git a/actionview/test/fixtures/fun/games/_form.erb b/actionview/test/fixtures/fun/games/_form.erb
new file mode 100644
index 0000000000..01107f1cb2
--- /dev/null
+++ b/actionview/test/fixtures/fun/games/_form.erb
@@ -0,0 +1 @@
+<%= form.label :title %>
diff --git a/actionview/test/fixtures/fun/games/_game.erb b/actionview/test/fixtures/fun/games/_game.erb
new file mode 100644
index 0000000000..f0f542ff92
--- /dev/null
+++ b/actionview/test/fixtures/fun/games/_game.erb
@@ -0,0 +1 @@
+Fun <%= game.name %>
diff --git a/actionview/test/fixtures/fun/games/hello_world.erb b/actionview/test/fixtures/fun/games/hello_world.erb
new file mode 100644
index 0000000000..1ebfbe2539
--- /dev/null
+++ b/actionview/test/fixtures/fun/games/hello_world.erb
@@ -0,0 +1 @@
+Living in a nested world
\ No newline at end of file
diff --git a/actionview/test/fixtures/fun/serious/games/_game.erb b/actionview/test/fixtures/fun/serious/games/_game.erb
new file mode 100644
index 0000000000..523bc55bd7
--- /dev/null
+++ b/actionview/test/fixtures/fun/serious/games/_game.erb
@@ -0,0 +1 @@
+Serious <%= game.name %>
diff --git a/actionview/test/fixtures/functional_caching/_partial.erb b/actionview/test/fixtures/functional_caching/_partial.erb
new file mode 100644
index 0000000000..ec0da7cf50
--- /dev/null
+++ b/actionview/test/fixtures/functional_caching/_partial.erb
@@ -0,0 +1,3 @@
+<% cache do %>
+Old fragment caching in a partial
+<% end %>
diff --git a/actionview/test/fixtures/functional_caching/formatted_fragment_cached.html.erb b/actionview/test/fixtures/functional_caching/formatted_fragment_cached.html.erb
new file mode 100644
index 0000000000..9b88fa1f5a
--- /dev/null
+++ b/actionview/test/fixtures/functional_caching/formatted_fragment_cached.html.erb
@@ -0,0 +1,3 @@
+
+<%= cache do %>
ERB
<% end %>
+
diff --git a/actionview/test/fixtures/functional_caching/formatted_fragment_cached.xml.builder b/actionview/test/fixtures/functional_caching/formatted_fragment_cached.xml.builder
new file mode 100644
index 0000000000..efdcc28e0f
--- /dev/null
+++ b/actionview/test/fixtures/functional_caching/formatted_fragment_cached.xml.builder
@@ -0,0 +1,5 @@
+xml.body do
+ cache do
+ xml.p "Builder"
+ end
+end
diff --git a/actionview/test/fixtures/functional_caching/fragment_cached.html.erb b/actionview/test/fixtures/functional_caching/fragment_cached.html.erb
new file mode 100644
index 0000000000..fa5e6bd318
--- /dev/null
+++ b/actionview/test/fixtures/functional_caching/fragment_cached.html.erb
@@ -0,0 +1,3 @@
+Hello
+<%= cache do %>This bit's fragment cached<% end %>
+<%= 'Ciao' %>
diff --git a/actionview/test/fixtures/functional_caching/fragment_cached_without_digest.html.erb b/actionview/test/fixtures/functional_caching/fragment_cached_without_digest.html.erb
new file mode 100644
index 0000000000..3125583a28
--- /dev/null
+++ b/actionview/test/fixtures/functional_caching/fragment_cached_without_digest.html.erb
@@ -0,0 +1,3 @@
+
+<%= cache 'nodigest', skip_digest: true do %>
ERB
<% end %>
+
diff --git a/actionview/test/fixtures/functional_caching/html_fragment_cached_with_partial.html.erb b/actionview/test/fixtures/functional_caching/html_fragment_cached_with_partial.html.erb
new file mode 100644
index 0000000000..a9462d3499
--- /dev/null
+++ b/actionview/test/fixtures/functional_caching/html_fragment_cached_with_partial.html.erb
@@ -0,0 +1 @@
+<%= render :partial => 'partial' %>
\ No newline at end of file
diff --git a/actionview/test/fixtures/functional_caching/inline_fragment_cached.html.erb b/actionview/test/fixtures/functional_caching/inline_fragment_cached.html.erb
new file mode 100644
index 0000000000..41647f1404
--- /dev/null
+++ b/actionview/test/fixtures/functional_caching/inline_fragment_cached.html.erb
@@ -0,0 +1,2 @@
+<%= render :inline => 'Some inline content' %>
+<%= cache do %>Some cached content<% end %>
diff --git a/actionview/test/fixtures/games/_game.erb b/actionview/test/fixtures/games/_game.erb
new file mode 100644
index 0000000000..1aeb81fcba
--- /dev/null
+++ b/actionview/test/fixtures/games/_game.erb
@@ -0,0 +1 @@
+Just <%= game.name %>
diff --git a/actionview/test/fixtures/good_customers/_good_customer.html.erb b/actionview/test/fixtures/good_customers/_good_customer.html.erb
new file mode 100644
index 0000000000..a2d97ebc6d
--- /dev/null
+++ b/actionview/test/fixtures/good_customers/_good_customer.html.erb
@@ -0,0 +1 @@
+<%= greeting %> good customer: <%= good_customer.name %><%= good_customer_counter %>
\ No newline at end of file
diff --git a/actionview/test/fixtures/happy_path/render_action/hello_world.erb b/actionview/test/fixtures/happy_path/render_action/hello_world.erb
new file mode 100644
index 0000000000..6769dd60bd
--- /dev/null
+++ b/actionview/test/fixtures/happy_path/render_action/hello_world.erb
@@ -0,0 +1 @@
+Hello world!
\ No newline at end of file
diff --git a/actionview/test/fixtures/hello.html b/actionview/test/fixtures/hello.html
new file mode 100644
index 0000000000..6769dd60bd
--- /dev/null
+++ b/actionview/test/fixtures/hello.html
@@ -0,0 +1 @@
+Hello world!
\ No newline at end of file
diff --git a/actionview/test/fixtures/helpers/abc_helper.rb b/actionview/test/fixtures/helpers/abc_helper.rb
new file mode 100644
index 0000000000..7104ff3730
--- /dev/null
+++ b/actionview/test/fixtures/helpers/abc_helper.rb
@@ -0,0 +1,5 @@
+module AbcHelper
+ def bare_a() end
+ def bare_b() end
+ def bare_c() end
+end
diff --git a/actionview/test/fixtures/helpers/fun/games_helper.rb b/actionview/test/fixtures/helpers/fun/games_helper.rb
new file mode 100644
index 0000000000..3b7adce086
--- /dev/null
+++ b/actionview/test/fixtures/helpers/fun/games_helper.rb
@@ -0,0 +1,5 @@
+module Fun
+ module GamesHelper
+ def stratego() "Iz guuut!" end
+ end
+end
\ No newline at end of file
diff --git a/actionview/test/fixtures/helpers/fun/pdf_helper.rb b/actionview/test/fixtures/helpers/fun/pdf_helper.rb
new file mode 100644
index 0000000000..0171be8500
--- /dev/null
+++ b/actionview/test/fixtures/helpers/fun/pdf_helper.rb
@@ -0,0 +1,5 @@
+module Fun
+ module PdfHelper
+ def foobar() 'baz' end
+ end
+end
diff --git a/actionview/test/fixtures/helpers/helpery_test_helper.rb b/actionview/test/fixtures/helpers/helpery_test_helper.rb
new file mode 100644
index 0000000000..a4f2951efa
--- /dev/null
+++ b/actionview/test/fixtures/helpers/helpery_test_helper.rb
@@ -0,0 +1,5 @@
+module HelperyTestHelper
+ def helpery_test
+ "Default"
+ end
+end
diff --git a/actionview/test/fixtures/helpers/just_me_helper.rb b/actionview/test/fixtures/helpers/just_me_helper.rb
new file mode 100644
index 0000000000..b140a7b9b4
--- /dev/null
+++ b/actionview/test/fixtures/helpers/just_me_helper.rb
@@ -0,0 +1,3 @@
+module JustMeHelper
+ def me() "mine!" end
+end
\ No newline at end of file
diff --git a/actionview/test/fixtures/helpers/me_too_helper.rb b/actionview/test/fixtures/helpers/me_too_helper.rb
new file mode 100644
index 0000000000..ce56042143
--- /dev/null
+++ b/actionview/test/fixtures/helpers/me_too_helper.rb
@@ -0,0 +1,3 @@
+module MeTooHelper
+ def me() "me too!" end
+end
\ No newline at end of file
diff --git a/actionview/test/fixtures/helpers1_pack/pack1_helper.rb b/actionview/test/fixtures/helpers1_pack/pack1_helper.rb
new file mode 100644
index 0000000000..9faa427736
--- /dev/null
+++ b/actionview/test/fixtures/helpers1_pack/pack1_helper.rb
@@ -0,0 +1,5 @@
+module Pack1Helper
+ def conflicting_helper
+ "pack1"
+ end
+end
diff --git a/actionview/test/fixtures/helpers2_pack/pack2_helper.rb b/actionview/test/fixtures/helpers2_pack/pack2_helper.rb
new file mode 100644
index 0000000000..cf56697dfb
--- /dev/null
+++ b/actionview/test/fixtures/helpers2_pack/pack2_helper.rb
@@ -0,0 +1,5 @@
+module Pack2Helper
+ def conflicting_helper
+ "pack2"
+ end
+end
diff --git a/actionview/test/fixtures/layout_tests/alt/hello.erb b/actionview/test/fixtures/layout_tests/alt/hello.erb
new file mode 100644
index 0000000000..1055c36659
--- /dev/null
+++ b/actionview/test/fixtures/layout_tests/alt/hello.erb
@@ -0,0 +1 @@
+alt/hello.erb
diff --git a/actionview/test/fixtures/layout_tests/alt/layouts/alt.erb b/actionview/test/fixtures/layout_tests/alt/layouts/alt.erb
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/actionview/test/fixtures/layout_tests/layouts/controller_name_space/nested.erb b/actionview/test/fixtures/layout_tests/layouts/controller_name_space/nested.erb
new file mode 100644
index 0000000000..121bc079a1
--- /dev/null
+++ b/actionview/test/fixtures/layout_tests/layouts/controller_name_space/nested.erb
@@ -0,0 +1 @@
+controller_name_space/nested.erb <%= yield %>
\ No newline at end of file
diff --git a/actionview/test/fixtures/layout_tests/layouts/item.erb b/actionview/test/fixtures/layout_tests/layouts/item.erb
new file mode 100644
index 0000000000..60f04d77d5
--- /dev/null
+++ b/actionview/test/fixtures/layout_tests/layouts/item.erb
@@ -0,0 +1 @@
+item.erb <%= yield %>
\ No newline at end of file
diff --git a/actionview/test/fixtures/layout_tests/layouts/layout_test.erb b/actionview/test/fixtures/layout_tests/layouts/layout_test.erb
new file mode 100644
index 0000000000..b74ac0840d
--- /dev/null
+++ b/actionview/test/fixtures/layout_tests/layouts/layout_test.erb
@@ -0,0 +1 @@
+layout_test.erb <%= yield %>
\ No newline at end of file
diff --git a/actionview/test/fixtures/layout_tests/layouts/multiple_extensions.html.erb b/actionview/test/fixtures/layout_tests/layouts/multiple_extensions.html.erb
new file mode 100644
index 0000000000..3b65e54f9c
--- /dev/null
+++ b/actionview/test/fixtures/layout_tests/layouts/multiple_extensions.html.erb
@@ -0,0 +1 @@
+multiple_extensions.html.erb <%= yield %>
diff --git a/actionview/test/fixtures/layout_tests/layouts/symlinked b/actionview/test/fixtures/layout_tests/layouts/symlinked
new file mode 120000
index 0000000000..0ddc1154ab
--- /dev/null
+++ b/actionview/test/fixtures/layout_tests/layouts/symlinked
@@ -0,0 +1 @@
+../../symlink_parent
\ No newline at end of file
diff --git a/actionview/test/fixtures/layout_tests/layouts/third_party_template_library.mab b/actionview/test/fixtures/layout_tests/layouts/third_party_template_library.mab
new file mode 100644
index 0000000000..fcee620d82
--- /dev/null
+++ b/actionview/test/fixtures/layout_tests/layouts/third_party_template_library.mab
@@ -0,0 +1 @@
+layouts/third_party_template_library.mab
\ No newline at end of file
diff --git a/actionview/test/fixtures/layout_tests/views/goodbye.erb b/actionview/test/fixtures/layout_tests/views/goodbye.erb
new file mode 100644
index 0000000000..4ee911188e
--- /dev/null
+++ b/actionview/test/fixtures/layout_tests/views/goodbye.erb
@@ -0,0 +1 @@
+hello.erb
\ No newline at end of file
diff --git a/actionview/test/fixtures/layout_tests/views/hello.erb b/actionview/test/fixtures/layout_tests/views/hello.erb
new file mode 100644
index 0000000000..4ee911188e
--- /dev/null
+++ b/actionview/test/fixtures/layout_tests/views/hello.erb
@@ -0,0 +1 @@
+hello.erb
\ No newline at end of file
diff --git a/actionview/test/fixtures/layouts/_column.html.erb b/actionview/test/fixtures/layouts/_column.html.erb
new file mode 100644
index 0000000000..96db002b8a
--- /dev/null
+++ b/actionview/test/fixtures/layouts/_column.html.erb
@@ -0,0 +1,2 @@
+
<%= yield :column %>
+
<%= yield %>
\ No newline at end of file
diff --git a/actionview/test/fixtures/layouts/_customers.erb b/actionview/test/fixtures/layouts/_customers.erb
new file mode 100644
index 0000000000..ae63f13cd3
--- /dev/null
+++ b/actionview/test/fixtures/layouts/_customers.erb
@@ -0,0 +1 @@
+<%= yield Struct.new(:name).new("David") %>
\ No newline at end of file
diff --git a/actionview/test/fixtures/layouts/_partial_and_yield.erb b/actionview/test/fixtures/layouts/_partial_and_yield.erb
new file mode 100644
index 0000000000..74cc428ffa
--- /dev/null
+++ b/actionview/test/fixtures/layouts/_partial_and_yield.erb
@@ -0,0 +1,2 @@
+<%= render :partial => 'test/partial' %>
+<%= yield %>
diff --git a/actionview/test/fixtures/layouts/_yield_only.erb b/actionview/test/fixtures/layouts/_yield_only.erb
new file mode 100644
index 0000000000..37f0bddbd7
--- /dev/null
+++ b/actionview/test/fixtures/layouts/_yield_only.erb
@@ -0,0 +1 @@
+<%= yield %>
diff --git a/actionview/test/fixtures/layouts/_yield_with_params.erb b/actionview/test/fixtures/layouts/_yield_with_params.erb
new file mode 100644
index 0000000000..68e6557fb8
--- /dev/null
+++ b/actionview/test/fixtures/layouts/_yield_with_params.erb
@@ -0,0 +1 @@
+<%= yield 'Yield!' %>
diff --git a/actionview/test/fixtures/layouts/block_with_layout.erb b/actionview/test/fixtures/layouts/block_with_layout.erb
new file mode 100644
index 0000000000..73ac833e52
--- /dev/null
+++ b/actionview/test/fixtures/layouts/block_with_layout.erb
@@ -0,0 +1,3 @@
+<%= render(:layout => "layout_for_partial", :locals => { :name => "Anthony" }) do %>Inside from first block in layout<% "Return value should be discarded" %><% end %>
+<%= yield %>
+<%= render(:layout => "layout_for_partial", :locals => { :name => "Ramm" }) do %>Inside from second block in layout<% end %>
diff --git a/actionview/test/fixtures/layouts/builder.builder b/actionview/test/fixtures/layouts/builder.builder
new file mode 100644
index 0000000000..7c7d4b2dd1
--- /dev/null
+++ b/actionview/test/fixtures/layouts/builder.builder
@@ -0,0 +1,3 @@
+xml.wrapper do
+ xml << yield
+end
\ No newline at end of file
diff --git a/actionview/test/fixtures/layouts/partial_with_layout.erb b/actionview/test/fixtures/layouts/partial_with_layout.erb
new file mode 100644
index 0000000000..a0349d731e
--- /dev/null
+++ b/actionview/test/fixtures/layouts/partial_with_layout.erb
@@ -0,0 +1,3 @@
+<%= render( :layout => "layout_for_partial", :partial => "partial_for_use_in_layout", :locals => {:name => 'Anthony' } ) %>
+<%= yield %>
+<%= render( :layout => "layout_for_partial", :partial => "partial_for_use_in_layout", :locals => {:name => 'Ramm' } ) %>
\ No newline at end of file
diff --git a/actionview/test/fixtures/layouts/standard.html.erb b/actionview/test/fixtures/layouts/standard.html.erb
new file mode 100644
index 0000000000..5e6c24fe39
--- /dev/null
+++ b/actionview/test/fixtures/layouts/standard.html.erb
@@ -0,0 +1 @@
+<%= yield %><%= @variable_for_layout %>
\ No newline at end of file
diff --git a/actionview/test/fixtures/layouts/streaming.erb b/actionview/test/fixtures/layouts/streaming.erb
new file mode 100644
index 0000000000..d3f896a6ca
--- /dev/null
+++ b/actionview/test/fixtures/layouts/streaming.erb
@@ -0,0 +1,4 @@
+<%= yield :header -%>
+<%= yield -%>
+<%= yield :footer -%>
+<%= yield(:unknown).presence || "." -%>
\ No newline at end of file
diff --git a/actionview/test/fixtures/layouts/talk_from_action.erb b/actionview/test/fixtures/layouts/talk_from_action.erb
new file mode 100644
index 0000000000..bf53fdb785
--- /dev/null
+++ b/actionview/test/fixtures/layouts/talk_from_action.erb
@@ -0,0 +1,2 @@
+<%= @title || yield(:title) %>
+<%= yield -%>
\ No newline at end of file
diff --git a/actionview/test/fixtures/layouts/with_html_partial.html.erb b/actionview/test/fixtures/layouts/with_html_partial.html.erb
new file mode 100644
index 0000000000..fd2896aeaa
--- /dev/null
+++ b/actionview/test/fixtures/layouts/with_html_partial.html.erb
@@ -0,0 +1 @@
+<%= render :partial => "partial_only_html" %><%= yield %>
diff --git a/actionview/test/fixtures/layouts/xhr.html.erb b/actionview/test/fixtures/layouts/xhr.html.erb
new file mode 100644
index 0000000000..85285324ec
--- /dev/null
+++ b/actionview/test/fixtures/layouts/xhr.html.erb
@@ -0,0 +1,2 @@
+XHR!
+<%= yield %>
\ No newline at end of file
diff --git a/actionview/test/fixtures/layouts/yield.erb b/actionview/test/fixtures/layouts/yield.erb
new file mode 100644
index 0000000000..482dc9022e
--- /dev/null
+++ b/actionview/test/fixtures/layouts/yield.erb
@@ -0,0 +1,2 @@
+<%= yield :title %>
+<%= yield %>
diff --git a/actionview/test/fixtures/layouts/yield_with_render_inline_inside.erb b/actionview/test/fixtures/layouts/yield_with_render_inline_inside.erb
new file mode 100644
index 0000000000..7298d79690
--- /dev/null
+++ b/actionview/test/fixtures/layouts/yield_with_render_inline_inside.erb
@@ -0,0 +1,2 @@
+<%= render :inline => 'welcome' %>
+<%= yield %>
diff --git a/actionview/test/fixtures/layouts/yield_with_render_partial_inside.erb b/actionview/test/fixtures/layouts/yield_with_render_partial_inside.erb
new file mode 100644
index 0000000000..74cc428ffa
--- /dev/null
+++ b/actionview/test/fixtures/layouts/yield_with_render_partial_inside.erb
@@ -0,0 +1,2 @@
+<%= render :partial => 'test/partial' %>
+<%= yield %>
diff --git a/actionview/test/fixtures/localized/hello_world.de.html b/actionview/test/fixtures/localized/hello_world.de.html
new file mode 100644
index 0000000000..4727d7a7e0
--- /dev/null
+++ b/actionview/test/fixtures/localized/hello_world.de.html
@@ -0,0 +1 @@
+Gutten Tag
\ No newline at end of file
diff --git a/actionview/test/fixtures/localized/hello_world.en.html b/actionview/test/fixtures/localized/hello_world.en.html
new file mode 100644
index 0000000000..5e1c309dae
--- /dev/null
+++ b/actionview/test/fixtures/localized/hello_world.en.html
@@ -0,0 +1 @@
+Hello World
\ No newline at end of file
diff --git a/actionview/test/fixtures/mascot.rb b/actionview/test/fixtures/mascot.rb
new file mode 100644
index 0000000000..f9f1448b8f
--- /dev/null
+++ b/actionview/test/fixtures/mascot.rb
@@ -0,0 +1,3 @@
+class Mascot < ActiveRecord::Base
+ belongs_to :company
+end
\ No newline at end of file
diff --git a/actionview/test/fixtures/mascots.yml b/actionview/test/fixtures/mascots.yml
new file mode 100644
index 0000000000..17b7dff454
--- /dev/null
+++ b/actionview/test/fixtures/mascots.yml
@@ -0,0 +1,4 @@
+upload_bird:
+ id: 1
+ company_id: 1
+ name: The Upload Bird
\ No newline at end of file
diff --git a/actionview/test/fixtures/mascots/_mascot.html.erb b/actionview/test/fixtures/mascots/_mascot.html.erb
new file mode 100644
index 0000000000..432773a1da
--- /dev/null
+++ b/actionview/test/fixtures/mascots/_mascot.html.erb
@@ -0,0 +1 @@
+<%= mascot.name %>
\ No newline at end of file
diff --git a/actionview/test/fixtures/multipart/binary_file b/actionview/test/fixtures/multipart/binary_file
new file mode 100644
index 0000000000..556187ac1f
Binary files /dev/null and b/actionview/test/fixtures/multipart/binary_file differ
diff --git a/actionview/test/fixtures/multipart/boundary_problem_file b/actionview/test/fixtures/multipart/boundary_problem_file
new file mode 100644
index 0000000000..e81c4d8f1b
--- /dev/null
+++ b/actionview/test/fixtures/multipart/boundary_problem_file
@@ -0,0 +1,10 @@
+--AaB03x
+Content-Disposition: form-data; name="file"; filename="file.txt"
+Content-Type: text/plain
+
+bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb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bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
+--AaB03x
+Content-Disposition: form-data; name="foo"
+
+bar
+--AaB03x--
diff --git a/actionview/test/fixtures/multipart/bracketed_param b/actionview/test/fixtures/multipart/bracketed_param
new file mode 100644
index 0000000000..8bb66c9c84
--- /dev/null
+++ b/actionview/test/fixtures/multipart/bracketed_param
@@ -0,0 +1,5 @@
+--AaB03x
+Content-Disposition: form-data; name="foo[baz]"
+
+bar
+--AaB03x--
diff --git a/actionview/test/fixtures/multipart/bracketed_utf8_param b/actionview/test/fixtures/multipart/bracketed_utf8_param
new file mode 100644
index 0000000000..df9cecea08
--- /dev/null
+++ b/actionview/test/fixtures/multipart/bracketed_utf8_param
@@ -0,0 +1,5 @@
+--AaB03x
+Content-Disposition: form-data; name="Iñtërnâtiônàlizætiøn_name[Iñtërnâtiônàlizætiøn_nested_name]"
+
+Iñtërnâtiônàlizætiøn_value
+--AaB03x--
diff --git a/actionview/test/fixtures/multipart/empty b/actionview/test/fixtures/multipart/empty
new file mode 100644
index 0000000000..7ba009902e
--- /dev/null
+++ b/actionview/test/fixtures/multipart/empty
@@ -0,0 +1,10 @@
+--AaB03x
+Content-Disposition: form-data; name="submit-name"
+
+Larry
+--AaB03x
+Content-Disposition: form-data; name="files"; filename="file1.txt"
+Content-Type: text/plain
+
+
+--AaB03x--
diff --git a/actionview/test/fixtures/multipart/hello.txt b/actionview/test/fixtures/multipart/hello.txt
new file mode 100644
index 0000000000..5ab2f8a432
--- /dev/null
+++ b/actionview/test/fixtures/multipart/hello.txt
@@ -0,0 +1 @@
+Hello
\ No newline at end of file
diff --git a/actionview/test/fixtures/multipart/large_text_file b/actionview/test/fixtures/multipart/large_text_file
new file mode 100644
index 0000000000..dab4225860
--- /dev/null
+++ b/actionview/test/fixtures/multipart/large_text_file
@@ -0,0 +1,10 @@
+--AaB03x
+Content-Disposition: form-data; name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aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+--AaB03x--
diff --git a/actionview/test/fixtures/multipart/mixed_files b/actionview/test/fixtures/multipart/mixed_files
new file mode 100644
index 0000000000..5eba7a6b48
Binary files /dev/null and b/actionview/test/fixtures/multipart/mixed_files differ
diff --git a/actionview/test/fixtures/multipart/mona_lisa.jpg b/actionview/test/fixtures/multipart/mona_lisa.jpg
new file mode 100644
index 0000000000..5cf3bef3d0
Binary files /dev/null and b/actionview/test/fixtures/multipart/mona_lisa.jpg differ
diff --git a/actionview/test/fixtures/multipart/none b/actionview/test/fixtures/multipart/none
new file mode 100644
index 0000000000..47138799ba
--- /dev/null
+++ b/actionview/test/fixtures/multipart/none
@@ -0,0 +1,9 @@
+--AaB03x
+Content-Disposition: form-data; name="submit-name"
+
+Larry
+--AaB03x
+Content-Disposition: form-data; name="files"; filename=""
+
+
+--AaB03x--
diff --git a/actionview/test/fixtures/multipart/single_parameter b/actionview/test/fixtures/multipart/single_parameter
new file mode 100644
index 0000000000..75f0b3bba9
--- /dev/null
+++ b/actionview/test/fixtures/multipart/single_parameter
@@ -0,0 +1,5 @@
+--AaB03x
+Content-Disposition: form-data; name="foo"
+
+bar
+--AaB03x--
diff --git a/actionview/test/fixtures/multipart/single_utf8_param b/actionview/test/fixtures/multipart/single_utf8_param
new file mode 100644
index 0000000000..1d9fae7b17
--- /dev/null
+++ b/actionview/test/fixtures/multipart/single_utf8_param
@@ -0,0 +1,5 @@
+--AaB03x
+Content-Disposition: form-data; name="Iñtërnâtiônàlizætiøn_name"
+
+Iñtërnâtiônàlizætiøn_value
+--AaB03x--
diff --git a/actionview/test/fixtures/multipart/text_file b/actionview/test/fixtures/multipart/text_file
new file mode 100644
index 0000000000..133d4be43b
--- /dev/null
+++ b/actionview/test/fixtures/multipart/text_file
@@ -0,0 +1,10 @@
+--AaB03x
+Content-Disposition: form-data; name="foo"
+
+bar
+--AaB03x
+Content-Disposition: form-data; name="file"; filename="file.txt"
+Content-Type: text/plain
+
+contents
+--AaB03x--
diff --git a/actionview/test/fixtures/old_content_type/render_default_content_types_for_respond_to.xml.erb b/actionview/test/fixtures/old_content_type/render_default_content_types_for_respond_to.xml.erb
new file mode 100644
index 0000000000..25dc746886
--- /dev/null
+++ b/actionview/test/fixtures/old_content_type/render_default_content_types_for_respond_to.xml.erb
@@ -0,0 +1 @@
+world
\ No newline at end of file
diff --git a/actionview/test/fixtures/old_content_type/render_default_for_builder.builder b/actionview/test/fixtures/old_content_type/render_default_for_builder.builder
new file mode 100644
index 0000000000..598d62e2fc
--- /dev/null
+++ b/actionview/test/fixtures/old_content_type/render_default_for_builder.builder
@@ -0,0 +1 @@
+xml.p "Hello world!"
\ No newline at end of file
diff --git a/actionview/test/fixtures/old_content_type/render_default_for_erb.erb b/actionview/test/fixtures/old_content_type/render_default_for_erb.erb
new file mode 100644
index 0000000000..c7926d48bb
--- /dev/null
+++ b/actionview/test/fixtures/old_content_type/render_default_for_erb.erb
@@ -0,0 +1 @@
+<%= 'hello world!' %>
\ No newline at end of file
diff --git a/actionview/test/fixtures/override/test/hello_world.erb b/actionview/test/fixtures/override/test/hello_world.erb
new file mode 100644
index 0000000000..3e308d3d86
--- /dev/null
+++ b/actionview/test/fixtures/override/test/hello_world.erb
@@ -0,0 +1 @@
+Hello overridden world!
\ No newline at end of file
diff --git a/actionview/test/fixtures/override2/layouts/test/sub.erb b/actionview/test/fixtures/override2/layouts/test/sub.erb
new file mode 100644
index 0000000000..3863d5a8ef
--- /dev/null
+++ b/actionview/test/fixtures/override2/layouts/test/sub.erb
@@ -0,0 +1 @@
+layout: <%= yield %>
\ No newline at end of file
diff --git a/actionview/test/fixtures/plain_text.raw b/actionview/test/fixtures/plain_text.raw
new file mode 100644
index 0000000000..b13985337f
--- /dev/null
+++ b/actionview/test/fixtures/plain_text.raw
@@ -0,0 +1 @@
+<%= hello_world %>
diff --git a/actionview/test/fixtures/plain_text_with_characters.raw b/actionview/test/fixtures/plain_text_with_characters.raw
new file mode 100644
index 0000000000..1e86e44fb4
--- /dev/null
+++ b/actionview/test/fixtures/plain_text_with_characters.raw
@@ -0,0 +1 @@
+Here are some characters: !@#$%^&*()-="'}{`
diff --git a/actionview/test/fixtures/post_test/layouts/post.html.erb b/actionview/test/fixtures/post_test/layouts/post.html.erb
new file mode 100644
index 0000000000..c6c1a586dd
--- /dev/null
+++ b/actionview/test/fixtures/post_test/layouts/post.html.erb
@@ -0,0 +1 @@
+
<%= yield %>
\ No newline at end of file
diff --git a/actionview/test/fixtures/post_test/layouts/super_post.iphone.erb b/actionview/test/fixtures/post_test/layouts/super_post.iphone.erb
new file mode 100644
index 0000000000..db0e43694d
--- /dev/null
+++ b/actionview/test/fixtures/post_test/layouts/super_post.iphone.erb
@@ -0,0 +1 @@
+
<%= yield %>
\ No newline at end of file
diff --git a/actionview/test/fixtures/post_test/post/index.html.erb b/actionview/test/fixtures/post_test/post/index.html.erb
new file mode 100644
index 0000000000..b349b25618
--- /dev/null
+++ b/actionview/test/fixtures/post_test/post/index.html.erb
@@ -0,0 +1 @@
+Hello Firefox
\ No newline at end of file
diff --git a/actionview/test/fixtures/post_test/post/index.iphone.erb b/actionview/test/fixtures/post_test/post/index.iphone.erb
new file mode 100644
index 0000000000..d741e44351
--- /dev/null
+++ b/actionview/test/fixtures/post_test/post/index.iphone.erb
@@ -0,0 +1 @@
+Hello iPhone
\ No newline at end of file
diff --git a/actionview/test/fixtures/post_test/super_post/index.html.erb b/actionview/test/fixtures/post_test/super_post/index.html.erb
new file mode 100644
index 0000000000..7fc2eb190a
--- /dev/null
+++ b/actionview/test/fixtures/post_test/super_post/index.html.erb
@@ -0,0 +1 @@
+Super Firefox
\ No newline at end of file
diff --git a/actionview/test/fixtures/post_test/super_post/index.iphone.erb b/actionview/test/fixtures/post_test/super_post/index.iphone.erb
new file mode 100644
index 0000000000..99063a8d8c
--- /dev/null
+++ b/actionview/test/fixtures/post_test/super_post/index.iphone.erb
@@ -0,0 +1 @@
+Super iPhone
\ No newline at end of file
diff --git a/actionview/test/fixtures/project.rb b/actionview/test/fixtures/project.rb
new file mode 100644
index 0000000000..c124a9e605
--- /dev/null
+++ b/actionview/test/fixtures/project.rb
@@ -0,0 +1,3 @@
+class Project < ActiveRecord::Base
+ has_and_belongs_to_many :developers, -> { uniq }
+end
diff --git a/actionview/test/fixtures/projects.yml b/actionview/test/fixtures/projects.yml
new file mode 100644
index 0000000000..02800c7824
--- /dev/null
+++ b/actionview/test/fixtures/projects.yml
@@ -0,0 +1,7 @@
+action_controller:
+ id: 2
+ name: Active Controller
+
+active_record:
+ id: 1
+ name: Active Record
diff --git a/actionview/test/fixtures/projects/_project.erb b/actionview/test/fixtures/projects/_project.erb
new file mode 100644
index 0000000000..480c4c2af3
--- /dev/null
+++ b/actionview/test/fixtures/projects/_project.erb
@@ -0,0 +1 @@
+<%= project.name %>
\ No newline at end of file
diff --git a/actionview/test/fixtures/public/.gitignore b/actionview/test/fixtures/public/.gitignore
new file mode 100644
index 0000000000..312e635ee6
--- /dev/null
+++ b/actionview/test/fixtures/public/.gitignore
@@ -0,0 +1 @@
+absolute/*
diff --git a/actionview/test/fixtures/public/404.html b/actionview/test/fixtures/public/404.html
new file mode 100644
index 0000000000..497397ccea
--- /dev/null
+++ b/actionview/test/fixtures/public/404.html
@@ -0,0 +1 @@
+404 error fixture
diff --git a/actionview/test/fixtures/public/500.da.html b/actionview/test/fixtures/public/500.da.html
new file mode 100644
index 0000000000..a497c13656
--- /dev/null
+++ b/actionview/test/fixtures/public/500.da.html
@@ -0,0 +1 @@
+500 localized error fixture
diff --git a/actionview/test/fixtures/public/500.html b/actionview/test/fixtures/public/500.html
new file mode 100644
index 0000000000..7c66c7a943
--- /dev/null
+++ b/actionview/test/fixtures/public/500.html
@@ -0,0 +1 @@
+500 error fixture
diff --git a/actionview/test/fixtures/public/elsewhere/cools.js b/actionview/test/fixtures/public/elsewhere/cools.js
new file mode 100644
index 0000000000..6e12fe29c4
--- /dev/null
+++ b/actionview/test/fixtures/public/elsewhere/cools.js
@@ -0,0 +1 @@
+// cools.js
\ No newline at end of file
diff --git a/actionview/test/fixtures/public/elsewhere/file.css b/actionview/test/fixtures/public/elsewhere/file.css
new file mode 100644
index 0000000000..6aea0733b1
--- /dev/null
+++ b/actionview/test/fixtures/public/elsewhere/file.css
@@ -0,0 +1 @@
+/*file.css*/
\ No newline at end of file
diff --git a/actionview/test/fixtures/public/foo/bar.html b/actionview/test/fixtures/public/foo/bar.html
new file mode 100644
index 0000000000..9a35646205
--- /dev/null
+++ b/actionview/test/fixtures/public/foo/bar.html
@@ -0,0 +1 @@
+/foo/bar.html
\ No newline at end of file
diff --git a/actionview/test/fixtures/public/foo/baz.css b/actionview/test/fixtures/public/foo/baz.css
new file mode 100644
index 0000000000..b5173fbef2
--- /dev/null
+++ b/actionview/test/fixtures/public/foo/baz.css
@@ -0,0 +1,3 @@
+body {
+background: #000;
+}
diff --git a/actionview/test/fixtures/public/foo/index.html b/actionview/test/fixtures/public/foo/index.html
new file mode 100644
index 0000000000..497a2e898f
--- /dev/null
+++ b/actionview/test/fixtures/public/foo/index.html
@@ -0,0 +1 @@
+/foo/index.html
\ No newline at end of file
diff --git "a/actionview/test/fixtures/public/foo/\343\201\223\343\202\223\343\201\253\343\201\241\343\201\257.html" "b/actionview/test/fixtures/public/foo/\343\201\223\343\202\223\343\201\253\343\201\241\343\201\257.html"
new file mode 100644
index 0000000000..1df9166522
--- /dev/null
+++ "b/actionview/test/fixtures/public/foo/\343\201\223\343\202\223\343\201\253\343\201\241\343\201\257.html"
@@ -0,0 +1 @@
+means hello in Japanese
diff --git a/actionview/test/fixtures/public/index.html b/actionview/test/fixtures/public/index.html
new file mode 100644
index 0000000000..525950ba6b
--- /dev/null
+++ b/actionview/test/fixtures/public/index.html
@@ -0,0 +1 @@
+/index.html
\ No newline at end of file
diff --git a/actionview/test/fixtures/public/javascripts/application.js b/actionview/test/fixtures/public/javascripts/application.js
new file mode 100644
index 0000000000..9702692980
--- /dev/null
+++ b/actionview/test/fixtures/public/javascripts/application.js
@@ -0,0 +1 @@
+// application js
\ No newline at end of file
diff --git a/actionview/test/fixtures/public/javascripts/bank.js b/actionview/test/fixtures/public/javascripts/bank.js
new file mode 100644
index 0000000000..4a1bee7182
--- /dev/null
+++ b/actionview/test/fixtures/public/javascripts/bank.js
@@ -0,0 +1 @@
+// bank js
\ No newline at end of file
diff --git a/actionview/test/fixtures/public/javascripts/common.javascript b/actionview/test/fixtures/public/javascripts/common.javascript
new file mode 100644
index 0000000000..2ae1929056
--- /dev/null
+++ b/actionview/test/fixtures/public/javascripts/common.javascript
@@ -0,0 +1 @@
+// common.javascript
\ No newline at end of file
diff --git a/actionview/test/fixtures/public/javascripts/controls.js b/actionview/test/fixtures/public/javascripts/controls.js
new file mode 100644
index 0000000000..88168d9f13
--- /dev/null
+++ b/actionview/test/fixtures/public/javascripts/controls.js
@@ -0,0 +1 @@
+// controls js
\ No newline at end of file
diff --git a/actionview/test/fixtures/public/javascripts/dragdrop.js b/actionview/test/fixtures/public/javascripts/dragdrop.js
new file mode 100644
index 0000000000..c07061ac0c
--- /dev/null
+++ b/actionview/test/fixtures/public/javascripts/dragdrop.js
@@ -0,0 +1 @@
+// dragdrop js
\ No newline at end of file
diff --git a/actionview/test/fixtures/public/javascripts/effects.js b/actionview/test/fixtures/public/javascripts/effects.js
new file mode 100644
index 0000000000..b555d63034
--- /dev/null
+++ b/actionview/test/fixtures/public/javascripts/effects.js
@@ -0,0 +1 @@
+// effects js
\ No newline at end of file
diff --git a/actionview/test/fixtures/public/javascripts/prototype.js b/actionview/test/fixtures/public/javascripts/prototype.js
new file mode 100644
index 0000000000..9780064a0e
--- /dev/null
+++ b/actionview/test/fixtures/public/javascripts/prototype.js
@@ -0,0 +1 @@
+// prototype js
\ No newline at end of file
diff --git a/actionview/test/fixtures/public/javascripts/robber.js b/actionview/test/fixtures/public/javascripts/robber.js
new file mode 100644
index 0000000000..eb82fcbdf4
--- /dev/null
+++ b/actionview/test/fixtures/public/javascripts/robber.js
@@ -0,0 +1 @@
+// robber js
\ No newline at end of file
diff --git a/actionview/test/fixtures/public/javascripts/subdir/subdir.js b/actionview/test/fixtures/public/javascripts/subdir/subdir.js
new file mode 100644
index 0000000000..9d23a67aa1
--- /dev/null
+++ b/actionview/test/fixtures/public/javascripts/subdir/subdir.js
@@ -0,0 +1 @@
+// subdir js
diff --git a/actionview/test/fixtures/public/javascripts/version.1.0.js b/actionview/test/fixtures/public/javascripts/version.1.0.js
new file mode 100644
index 0000000000..cfd5fce70e
--- /dev/null
+++ b/actionview/test/fixtures/public/javascripts/version.1.0.js
@@ -0,0 +1 @@
+// version.1.0 js
\ No newline at end of file
diff --git a/actionview/test/fixtures/public/stylesheets/bank.css b/actionview/test/fixtures/public/stylesheets/bank.css
new file mode 100644
index 0000000000..ea161b12b2
--- /dev/null
+++ b/actionview/test/fixtures/public/stylesheets/bank.css
@@ -0,0 +1 @@
+/* bank.css */
\ No newline at end of file
diff --git a/actionview/test/fixtures/public/stylesheets/random.styles b/actionview/test/fixtures/public/stylesheets/random.styles
new file mode 100644
index 0000000000..d4eeead95c
--- /dev/null
+++ b/actionview/test/fixtures/public/stylesheets/random.styles
@@ -0,0 +1 @@
+/* random.styles */
\ No newline at end of file
diff --git a/actionview/test/fixtures/public/stylesheets/robber.css b/actionview/test/fixtures/public/stylesheets/robber.css
new file mode 100644
index 0000000000..0fdd00a6a5
--- /dev/null
+++ b/actionview/test/fixtures/public/stylesheets/robber.css
@@ -0,0 +1 @@
+/* robber.css */
\ No newline at end of file
diff --git a/actionview/test/fixtures/public/stylesheets/subdir/subdir.css b/actionview/test/fixtures/public/stylesheets/subdir/subdir.css
new file mode 100644
index 0000000000..241152a905
--- /dev/null
+++ b/actionview/test/fixtures/public/stylesheets/subdir/subdir.css
@@ -0,0 +1 @@
+/* subdir.css */
diff --git a/actionview/test/fixtures/public/stylesheets/version.1.0.css b/actionview/test/fixtures/public/stylesheets/version.1.0.css
new file mode 100644
index 0000000000..30f5f9ba6e
--- /dev/null
+++ b/actionview/test/fixtures/public/stylesheets/version.1.0.css
@@ -0,0 +1 @@
+/* version.1.0.css */
\ No newline at end of file
diff --git a/actionview/test/fixtures/quiz/questions/_question.html.erb b/actionview/test/fixtures/quiz/questions/_question.html.erb
new file mode 100644
index 0000000000..fb4dcfee64
--- /dev/null
+++ b/actionview/test/fixtures/quiz/questions/_question.html.erb
@@ -0,0 +1 @@
+<%= question.name %>
\ No newline at end of file
diff --git a/actionview/test/fixtures/replies.yml b/actionview/test/fixtures/replies.yml
new file mode 100644
index 0000000000..2a3454b8bf
--- /dev/null
+++ b/actionview/test/fixtures/replies.yml
@@ -0,0 +1,15 @@
+witty_retort:
+ id: 1
+ topic_id: 1
+ developer_id: 1
+ content: Birdman is better!
+ created_at: <%= 6.hours.ago.to_s(:db) %>
+ updated_at: nil
+
+another:
+ id: 2
+ topic_id: 2
+ developer_id: 1
+ content: Nuh uh!
+ created_at: <%= 1.hour.ago.to_s(:db) %>
+ updated_at: nil
diff --git a/actionview/test/fixtures/replies/_reply.erb b/actionview/test/fixtures/replies/_reply.erb
new file mode 100644
index 0000000000..68baf548d8
--- /dev/null
+++ b/actionview/test/fixtures/replies/_reply.erb
@@ -0,0 +1 @@
+<%= reply.content %>
\ No newline at end of file
diff --git a/actionview/test/fixtures/reply.rb b/actionview/test/fixtures/reply.rb
new file mode 100644
index 0000000000..047522c55b
--- /dev/null
+++ b/actionview/test/fixtures/reply.rb
@@ -0,0 +1,7 @@
+class Reply < ActiveRecord::Base
+ scope :base, -> { all }
+ belongs_to :topic, -> { includes(:replies) }
+ belongs_to :developer
+
+ validates_presence_of :content
+end
diff --git a/actionview/test/fixtures/respond_to/all_types_with_layout.html.erb b/actionview/test/fixtures/respond_to/all_types_with_layout.html.erb
new file mode 100644
index 0000000000..84a84049f8
--- /dev/null
+++ b/actionview/test/fixtures/respond_to/all_types_with_layout.html.erb
@@ -0,0 +1 @@
+HTML for all_types_with_layout
\ No newline at end of file
diff --git a/actionview/test/fixtures/respond_to/custom_constant_handling_without_block.mobile.erb b/actionview/test/fixtures/respond_to/custom_constant_handling_without_block.mobile.erb
new file mode 100644
index 0000000000..0cdfa41494
--- /dev/null
+++ b/actionview/test/fixtures/respond_to/custom_constant_handling_without_block.mobile.erb
@@ -0,0 +1 @@
+Mobile
\ No newline at end of file
diff --git a/actionview/test/fixtures/respond_to/iphone_with_html_response_type.html.erb b/actionview/test/fixtures/respond_to/iphone_with_html_response_type.html.erb
new file mode 100644
index 0000000000..1f3f1c6516
--- /dev/null
+++ b/actionview/test/fixtures/respond_to/iphone_with_html_response_type.html.erb
@@ -0,0 +1 @@
+Hello future from <%= @type -%>!
\ No newline at end of file
diff --git a/actionview/test/fixtures/respond_to/iphone_with_html_response_type.iphone.erb b/actionview/test/fixtures/respond_to/iphone_with_html_response_type.iphone.erb
new file mode 100644
index 0000000000..17888ac303
--- /dev/null
+++ b/actionview/test/fixtures/respond_to/iphone_with_html_response_type.iphone.erb
@@ -0,0 +1 @@
+Hello iPhone future from <%= @type -%>!
\ No newline at end of file
diff --git a/actionview/test/fixtures/respond_to/layouts/missing.html.erb b/actionview/test/fixtures/respond_to/layouts/missing.html.erb
new file mode 100644
index 0000000000..d6f92a3120
--- /dev/null
+++ b/actionview/test/fixtures/respond_to/layouts/missing.html.erb
@@ -0,0 +1 @@
+
<%= yield %>
\ No newline at end of file
diff --git a/actionview/test/fixtures/respond_to/layouts/standard.html.erb b/actionview/test/fixtures/respond_to/layouts/standard.html.erb
new file mode 100644
index 0000000000..c6c1a586dd
--- /dev/null
+++ b/actionview/test/fixtures/respond_to/layouts/standard.html.erb
@@ -0,0 +1 @@
+
<%= yield %>
\ No newline at end of file
diff --git a/actionview/test/fixtures/respond_to/layouts/standard.iphone.erb b/actionview/test/fixtures/respond_to/layouts/standard.iphone.erb
new file mode 100644
index 0000000000..84444517f0
--- /dev/null
+++ b/actionview/test/fixtures/respond_to/layouts/standard.iphone.erb
@@ -0,0 +1 @@
+
<%= yield %>
\ No newline at end of file
diff --git a/actionview/test/fixtures/respond_to/using_defaults.html.erb b/actionview/test/fixtures/respond_to/using_defaults.html.erb
new file mode 100644
index 0000000000..6769dd60bd
--- /dev/null
+++ b/actionview/test/fixtures/respond_to/using_defaults.html.erb
@@ -0,0 +1 @@
+Hello world!
\ No newline at end of file
diff --git a/actionview/test/fixtures/respond_to/using_defaults.xml.builder b/actionview/test/fixtures/respond_to/using_defaults.xml.builder
new file mode 100644
index 0000000000..598d62e2fc
--- /dev/null
+++ b/actionview/test/fixtures/respond_to/using_defaults.xml.builder
@@ -0,0 +1 @@
+xml.p "Hello world!"
\ No newline at end of file
diff --git a/actionview/test/fixtures/respond_to/using_defaults_with_all.html.erb b/actionview/test/fixtures/respond_to/using_defaults_with_all.html.erb
new file mode 100644
index 0000000000..9f1f855269
--- /dev/null
+++ b/actionview/test/fixtures/respond_to/using_defaults_with_all.html.erb
@@ -0,0 +1 @@
+HTML!
diff --git a/actionview/test/fixtures/respond_to/using_defaults_with_type_list.html.erb b/actionview/test/fixtures/respond_to/using_defaults_with_type_list.html.erb
new file mode 100644
index 0000000000..6769dd60bd
--- /dev/null
+++ b/actionview/test/fixtures/respond_to/using_defaults_with_type_list.html.erb
@@ -0,0 +1 @@
+Hello world!
\ No newline at end of file
diff --git a/actionview/test/fixtures/respond_to/using_defaults_with_type_list.xml.builder b/actionview/test/fixtures/respond_to/using_defaults_with_type_list.xml.builder
new file mode 100644
index 0000000000..598d62e2fc
--- /dev/null
+++ b/actionview/test/fixtures/respond_to/using_defaults_with_type_list.xml.builder
@@ -0,0 +1 @@
+xml.p "Hello world!"
\ No newline at end of file
diff --git a/actionview/test/fixtures/respond_with/edit.html.erb b/actionview/test/fixtures/respond_with/edit.html.erb
new file mode 100644
index 0000000000..ae82dfa4fc
--- /dev/null
+++ b/actionview/test/fixtures/respond_with/edit.html.erb
@@ -0,0 +1 @@
+Edit world!
diff --git a/actionview/test/fixtures/respond_with/new.html.erb b/actionview/test/fixtures/respond_with/new.html.erb
new file mode 100644
index 0000000000..96c8f1b88b
--- /dev/null
+++ b/actionview/test/fixtures/respond_with/new.html.erb
@@ -0,0 +1 @@
+New world!
diff --git a/actionview/test/fixtures/respond_with/using_invalid_resource_with_template.xml.erb b/actionview/test/fixtures/respond_with/using_invalid_resource_with_template.xml.erb
new file mode 100644
index 0000000000..bf5869ed22
--- /dev/null
+++ b/actionview/test/fixtures/respond_with/using_invalid_resource_with_template.xml.erb
@@ -0,0 +1 @@
+I should not be displayed
\ No newline at end of file
diff --git a/actionview/test/fixtures/respond_with/using_options_with_template.xml.erb b/actionview/test/fixtures/respond_with/using_options_with_template.xml.erb
new file mode 100644
index 0000000000..b313017913
--- /dev/null
+++ b/actionview/test/fixtures/respond_with/using_options_with_template.xml.erb
@@ -0,0 +1 @@
+<%= @customer.name %>
\ No newline at end of file
diff --git a/actionview/test/fixtures/respond_with/using_resource.js.erb b/actionview/test/fixtures/respond_with/using_resource.js.erb
new file mode 100644
index 0000000000..4417680bce
--- /dev/null
+++ b/actionview/test/fixtures/respond_with/using_resource.js.erb
@@ -0,0 +1 @@
+alert("Hi");
\ No newline at end of file
diff --git a/actionview/test/fixtures/respond_with/using_resource_with_block.html.erb b/actionview/test/fixtures/respond_with/using_resource_with_block.html.erb
new file mode 100644
index 0000000000..6769dd60bd
--- /dev/null
+++ b/actionview/test/fixtures/respond_with/using_resource_with_block.html.erb
@@ -0,0 +1 @@
+Hello world!
\ No newline at end of file
diff --git a/actionview/test/fixtures/ruby_template.ruby b/actionview/test/fixtures/ruby_template.ruby
new file mode 100644
index 0000000000..5097bce47c
--- /dev/null
+++ b/actionview/test/fixtures/ruby_template.ruby
@@ -0,0 +1,2 @@
+body = ""
+body << ["Hello", "from", "Ruby", "code"].join(" ")
diff --git a/actionview/test/fixtures/scope/test/modgreet.erb b/actionview/test/fixtures/scope/test/modgreet.erb
new file mode 100644
index 0000000000..8947726e89
--- /dev/null
+++ b/actionview/test/fixtures/scope/test/modgreet.erb
@@ -0,0 +1 @@
+
Beautiful modules!
\ No newline at end of file
diff --git a/actionview/test/fixtures/session_autoload_test/session_autoload_test/foo.rb b/actionview/test/fixtures/session_autoload_test/session_autoload_test/foo.rb
new file mode 100644
index 0000000000..4ee7a24561
--- /dev/null
+++ b/actionview/test/fixtures/session_autoload_test/session_autoload_test/foo.rb
@@ -0,0 +1,10 @@
+module SessionAutoloadTest
+ class Foo
+ def initialize(bar='baz')
+ @bar = bar
+ end
+ def inspect
+ "#<#{self.class} bar:#{@bar.inspect}>"
+ end
+ end
+end
diff --git a/actionview/test/fixtures/shared.html.erb b/actionview/test/fixtures/shared.html.erb
new file mode 100644
index 0000000000..af262fc9f8
--- /dev/null
+++ b/actionview/test/fixtures/shared.html.erb
@@ -0,0 +1 @@
+Elastica
\ No newline at end of file
diff --git a/actionview/test/fixtures/star_star_mime/index.js.erb b/actionview/test/fixtures/star_star_mime/index.js.erb
new file mode 100644
index 0000000000..4da4181f56
--- /dev/null
+++ b/actionview/test/fixtures/star_star_mime/index.js.erb
@@ -0,0 +1 @@
+function addition(a,b){ return a+b; }
diff --git a/actionview/test/fixtures/symlink_parent/symlinked_layout.erb b/actionview/test/fixtures/symlink_parent/symlinked_layout.erb
new file mode 100644
index 0000000000..bda57d0fae
--- /dev/null
+++ b/actionview/test/fixtures/symlink_parent/symlinked_layout.erb
@@ -0,0 +1,5 @@
+This is my layout
+
+<%= yield %>
+
+End.
diff --git a/actionview/test/fixtures/test/_200.html.erb b/actionview/test/fixtures/test/_200.html.erb
new file mode 100644
index 0000000000..c9f45675dc
--- /dev/null
+++ b/actionview/test/fixtures/test/_200.html.erb
@@ -0,0 +1 @@
+
Invalid partial
diff --git a/actionview/test/fixtures/test/_b_layout_for_partial.html.erb b/actionview/test/fixtures/test/_b_layout_for_partial.html.erb
new file mode 100644
index 0000000000..e918ba8f83
--- /dev/null
+++ b/actionview/test/fixtures/test/_b_layout_for_partial.html.erb
@@ -0,0 +1 @@
+<%= yield %>
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/_b_layout_for_partial_with_object.html.erb b/actionview/test/fixtures/test/_b_layout_for_partial_with_object.html.erb
new file mode 100644
index 0000000000..bdd53014cd
--- /dev/null
+++ b/actionview/test/fixtures/test/_b_layout_for_partial_with_object.html.erb
@@ -0,0 +1 @@
+<%= yield %>
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/_b_layout_for_partial_with_object_counter.html.erb b/actionview/test/fixtures/test/_b_layout_for_partial_with_object_counter.html.erb
new file mode 100644
index 0000000000..44d6121297
--- /dev/null
+++ b/actionview/test/fixtures/test/_b_layout_for_partial_with_object_counter.html.erb
@@ -0,0 +1 @@
+<%= yield %>
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/_changing_priority.html.erb b/actionview/test/fixtures/test/_changing_priority.html.erb
new file mode 100644
index 0000000000..3225efc49a
--- /dev/null
+++ b/actionview/test/fixtures/test/_changing_priority.html.erb
@@ -0,0 +1 @@
+HTML
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/_changing_priority.json.erb b/actionview/test/fixtures/test/_changing_priority.json.erb
new file mode 100644
index 0000000000..7fa41dce66
--- /dev/null
+++ b/actionview/test/fixtures/test/_changing_priority.json.erb
@@ -0,0 +1 @@
+JSON
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/_content_tag_nested_in_content_tag.erb b/actionview/test/fixtures/test/_content_tag_nested_in_content_tag.erb
new file mode 100644
index 0000000000..2f21a75dd9
--- /dev/null
+++ b/actionview/test/fixtures/test/_content_tag_nested_in_content_tag.erb
@@ -0,0 +1,3 @@
+<%= content_tag 'p' do %>
+ <%= content_tag 'b', 'Hello' %>
+<% end %>
diff --git a/actionview/test/fixtures/test/_counter.html.erb b/actionview/test/fixtures/test/_counter.html.erb
new file mode 100644
index 0000000000..fd245bfc70
--- /dev/null
+++ b/actionview/test/fixtures/test/_counter.html.erb
@@ -0,0 +1 @@
+<%= counter_counter %>
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/_customer.erb b/actionview/test/fixtures/test/_customer.erb
new file mode 100644
index 0000000000..d8220afeda
--- /dev/null
+++ b/actionview/test/fixtures/test/_customer.erb
@@ -0,0 +1 @@
+Hello: <%= customer.name rescue "Anonymous" %>
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/_customer_counter.erb b/actionview/test/fixtures/test/_customer_counter.erb
new file mode 100644
index 0000000000..3435979dba
--- /dev/null
+++ b/actionview/test/fixtures/test/_customer_counter.erb
@@ -0,0 +1 @@
+<%= customer_counter.name %><%= customer_counter_counter %>
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/_customer_counter_with_as.erb b/actionview/test/fixtures/test/_customer_counter_with_as.erb
new file mode 100644
index 0000000000..1241eb604d
--- /dev/null
+++ b/actionview/test/fixtures/test/_customer_counter_with_as.erb
@@ -0,0 +1 @@
+<%= client.name %><%= client_counter %>
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/_customer_greeting.erb b/actionview/test/fixtures/test/_customer_greeting.erb
new file mode 100644
index 0000000000..6acbcb20c4
--- /dev/null
+++ b/actionview/test/fixtures/test/_customer_greeting.erb
@@ -0,0 +1 @@
+<%= greeting %>: <%= customer_greeting.name %>
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/_customer_with_var.erb b/actionview/test/fixtures/test/_customer_with_var.erb
new file mode 100644
index 0000000000..00047dd20e
--- /dev/null
+++ b/actionview/test/fixtures/test/_customer_with_var.erb
@@ -0,0 +1 @@
+<%= customer.name %> <%= customer.name %> <%= customer.name %>
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/_directory/_partial_with_locales.html.erb b/actionview/test/fixtures/test/_directory/_partial_with_locales.html.erb
new file mode 100644
index 0000000000..1cc8d41475
--- /dev/null
+++ b/actionview/test/fixtures/test/_directory/_partial_with_locales.html.erb
@@ -0,0 +1 @@
+Hello <%= name %>
diff --git a/actionview/test/fixtures/test/_first_json_partial.json.erb b/actionview/test/fixtures/test/_first_json_partial.json.erb
new file mode 100644
index 0000000000..790ee896db
--- /dev/null
+++ b/actionview/test/fixtures/test/_first_json_partial.json.erb
@@ -0,0 +1 @@
+<%= render :partial => "test/second_json_partial" %>
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/_form.erb b/actionview/test/fixtures/test/_form.erb
new file mode 100644
index 0000000000..01107f1cb2
--- /dev/null
+++ b/actionview/test/fixtures/test/_form.erb
@@ -0,0 +1 @@
+<%= form.label :title %>
diff --git a/actionview/test/fixtures/test/_from_helper.erb b/actionview/test/fixtures/test/_from_helper.erb
new file mode 100644
index 0000000000..16de7c0f8a
--- /dev/null
+++ b/actionview/test/fixtures/test/_from_helper.erb
@@ -0,0 +1 @@
+<%= render_from_helper %>
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/_hash_greeting.erb b/actionview/test/fixtures/test/_hash_greeting.erb
new file mode 100644
index 0000000000..fc54a36f2a
--- /dev/null
+++ b/actionview/test/fixtures/test/_hash_greeting.erb
@@ -0,0 +1 @@
+<%= greeting %>: <%= hash_greeting[:first_name] %>
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/_hash_object.erb b/actionview/test/fixtures/test/_hash_object.erb
new file mode 100644
index 0000000000..34a92c6a56
--- /dev/null
+++ b/actionview/test/fixtures/test/_hash_object.erb
@@ -0,0 +1,2 @@
+<%= hash_object[:first_name] %>
+<%= hash_object[:first_name].reverse %>
diff --git a/actionview/test/fixtures/test/_hello.builder b/actionview/test/fixtures/test/_hello.builder
new file mode 100644
index 0000000000..ef52f632d1
--- /dev/null
+++ b/actionview/test/fixtures/test/_hello.builder
@@ -0,0 +1 @@
+xm.hello
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/_json_change_priority.json.erb b/actionview/test/fixtures/test/_json_change_priority.json.erb
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/actionview/test/fixtures/test/_label_with_block.erb b/actionview/test/fixtures/test/_label_with_block.erb
new file mode 100644
index 0000000000..40117e594e
--- /dev/null
+++ b/actionview/test/fixtures/test/_label_with_block.erb
@@ -0,0 +1,4 @@
+<%= label 'post', 'message' do %>
+ Message
+ <%= text_field 'post', 'message' %>
+<% end %>
diff --git a/actionview/test/fixtures/test/_labelling_form.erb b/actionview/test/fixtures/test/_labelling_form.erb
new file mode 100644
index 0000000000..1b95763165
--- /dev/null
+++ b/actionview/test/fixtures/test/_labelling_form.erb
@@ -0,0 +1 @@
+<%= labelling_form.label :title %>
diff --git a/actionview/test/fixtures/test/_layout_for_block_with_args.html.erb b/actionview/test/fixtures/test/_layout_for_block_with_args.html.erb
new file mode 100644
index 0000000000..307533208d
--- /dev/null
+++ b/actionview/test/fixtures/test/_layout_for_block_with_args.html.erb
@@ -0,0 +1,3 @@
+Before
+<%= yield 'arg1', 'arg2' %>
+After
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/_layout_for_partial.html.erb b/actionview/test/fixtures/test/_layout_for_partial.html.erb
new file mode 100644
index 0000000000..666efadbb6
--- /dev/null
+++ b/actionview/test/fixtures/test/_layout_for_partial.html.erb
@@ -0,0 +1,3 @@
+Before (<%= name %>)
+<%= yield %>
+After
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/_layout_with_partial_and_yield.html.erb b/actionview/test/fixtures/test/_layout_with_partial_and_yield.html.erb
new file mode 100644
index 0000000000..820e7db789
--- /dev/null
+++ b/actionview/test/fixtures/test/_layout_with_partial_and_yield.html.erb
@@ -0,0 +1,4 @@
+Before
+<%= render :partial => "test/partial" %>
+<%= yield %>
+After
diff --git a/actionview/test/fixtures/test/_local_inspector.html.erb b/actionview/test/fixtures/test/_local_inspector.html.erb
new file mode 100644
index 0000000000..e6765c0882
--- /dev/null
+++ b/actionview/test/fixtures/test/_local_inspector.html.erb
@@ -0,0 +1 @@
+<%= local_assigns.keys.map {|k| k.to_s }.sort.join(",") -%>
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/_object_inspector.erb b/actionview/test/fixtures/test/_object_inspector.erb
new file mode 100644
index 0000000000..53af593821
--- /dev/null
+++ b/actionview/test/fixtures/test/_object_inspector.erb
@@ -0,0 +1 @@
+<%= object_inspector.inspect -%>
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/_one.html.erb b/actionview/test/fixtures/test/_one.html.erb
new file mode 100644
index 0000000000..f796291cb4
--- /dev/null
+++ b/actionview/test/fixtures/test/_one.html.erb
@@ -0,0 +1 @@
+<%= render :partial => "two" %> world
diff --git a/actionview/test/fixtures/test/_partial.erb b/actionview/test/fixtures/test/_partial.erb
new file mode 100644
index 0000000000..e466dcbd8e
--- /dev/null
+++ b/actionview/test/fixtures/test/_partial.erb
@@ -0,0 +1 @@
+invalid
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/_partial.html.erb b/actionview/test/fixtures/test/_partial.html.erb
new file mode 100644
index 0000000000..e39f6c9827
--- /dev/null
+++ b/actionview/test/fixtures/test/_partial.html.erb
@@ -0,0 +1 @@
+partial html
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/_partial.js.erb b/actionview/test/fixtures/test/_partial.js.erb
new file mode 100644
index 0000000000..b350cdd7ef
--- /dev/null
+++ b/actionview/test/fixtures/test/_partial.js.erb
@@ -0,0 +1 @@
+partial js
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/_partial_for_use_in_layout.html.erb b/actionview/test/fixtures/test/_partial_for_use_in_layout.html.erb
new file mode 100644
index 0000000000..3a03a64e31
--- /dev/null
+++ b/actionview/test/fixtures/test/_partial_for_use_in_layout.html.erb
@@ -0,0 +1 @@
+Inside from partial (<%= name %>)
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/_partial_html_erb.html.erb b/actionview/test/fixtures/test/_partial_html_erb.html.erb
new file mode 100644
index 0000000000..4b54875782
--- /dev/null
+++ b/actionview/test/fixtures/test/_partial_html_erb.html.erb
@@ -0,0 +1 @@
+<%= "partial.html.erb" %>
diff --git a/actionview/test/fixtures/test/_partial_name_local_variable.erb b/actionview/test/fixtures/test/_partial_name_local_variable.erb
new file mode 100644
index 0000000000..cc3a91c89f
--- /dev/null
+++ b/actionview/test/fixtures/test/_partial_name_local_variable.erb
@@ -0,0 +1 @@
+<%= partial_name_local_variable %>
diff --git a/actionview/test/fixtures/test/_partial_only.erb b/actionview/test/fixtures/test/_partial_only.erb
new file mode 100644
index 0000000000..a44b3eed40
--- /dev/null
+++ b/actionview/test/fixtures/test/_partial_only.erb
@@ -0,0 +1 @@
+only partial
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/_partial_only_html.html b/actionview/test/fixtures/test/_partial_only_html.html
new file mode 100644
index 0000000000..d2d630bd40
--- /dev/null
+++ b/actionview/test/fixtures/test/_partial_only_html.html
@@ -0,0 +1 @@
+only html partial
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/_partial_with_layout.erb b/actionview/test/fixtures/test/_partial_with_layout.erb
new file mode 100644
index 0000000000..2a50c834fe
--- /dev/null
+++ b/actionview/test/fixtures/test/_partial_with_layout.erb
@@ -0,0 +1,2 @@
+<%= render :partial => 'test/partial', :layout => 'test/layout_for_partial', :locals => { :name => 'Bar!' } %>
+partial with layout
diff --git a/actionview/test/fixtures/test/_partial_with_layout_block_content.erb b/actionview/test/fixtures/test/_partial_with_layout_block_content.erb
new file mode 100644
index 0000000000..65dafd93a8
--- /dev/null
+++ b/actionview/test/fixtures/test/_partial_with_layout_block_content.erb
@@ -0,0 +1,4 @@
+<%= render :layout => 'test/layout_for_partial', :locals => { :name => 'Bar!' } do %>
+ Content from inside layout!
+<% end %>
+partial with layout
diff --git a/actionview/test/fixtures/test/_partial_with_layout_block_partial.erb b/actionview/test/fixtures/test/_partial_with_layout_block_partial.erb
new file mode 100644
index 0000000000..444197a7d0
--- /dev/null
+++ b/actionview/test/fixtures/test/_partial_with_layout_block_partial.erb
@@ -0,0 +1,4 @@
+<%= render :layout => 'test/layout_for_partial', :locals => { :name => 'Bar!' } do %>
+ <%= render 'test/partial' %>
+<% end %>
+partial with layout
diff --git a/actionview/test/fixtures/test/_partial_with_only_html_version.html.erb b/actionview/test/fixtures/test/_partial_with_only_html_version.html.erb
new file mode 100644
index 0000000000..00e6b6d6da
--- /dev/null
+++ b/actionview/test/fixtures/test/_partial_with_only_html_version.html.erb
@@ -0,0 +1 @@
+partial with only html version
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/_partial_with_partial.erb b/actionview/test/fixtures/test/_partial_with_partial.erb
new file mode 100644
index 0000000000..ee0d5037b6
--- /dev/null
+++ b/actionview/test/fixtures/test/_partial_with_partial.erb
@@ -0,0 +1,2 @@
+<%= render 'test/partial' %>
+partial with partial
diff --git a/actionview/test/fixtures/test/_person.erb b/actionview/test/fixtures/test/_person.erb
new file mode 100644
index 0000000000..b2e5688956
--- /dev/null
+++ b/actionview/test/fixtures/test/_person.erb
@@ -0,0 +1,2 @@
+Second: <%= name %>
+Third: <%= @name %>
diff --git a/actionview/test/fixtures/test/_raise.html.erb b/actionview/test/fixtures/test/_raise.html.erb
new file mode 100644
index 0000000000..68b08181d3
--- /dev/null
+++ b/actionview/test/fixtures/test/_raise.html.erb
@@ -0,0 +1 @@
+<%= doesnt_exist %>
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/_raise_indentation.html.erb b/actionview/test/fixtures/test/_raise_indentation.html.erb
new file mode 100644
index 0000000000..f9a93728fe
--- /dev/null
+++ b/actionview/test/fixtures/test/_raise_indentation.html.erb
@@ -0,0 +1,13 @@
+
First paragraph
+
Second paragraph
+
Third paragraph
+
Fourth paragraph
+
Fifth paragraph
+
Sixth paragraph
+
Seventh paragraph
+
Eight paragraph
+
Ninth paragraph
+
Tenth paragraph
+<%= raise "error here!" %>
+
Eleventh paragraph
+
Twelfth paragraph
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/_second_json_partial.json.erb b/actionview/test/fixtures/test/_second_json_partial.json.erb
new file mode 100644
index 0000000000..5ebb7f1afd
--- /dev/null
+++ b/actionview/test/fixtures/test/_second_json_partial.json.erb
@@ -0,0 +1 @@
+Third level
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/_two.html.erb b/actionview/test/fixtures/test/_two.html.erb
new file mode 100644
index 0000000000..5ab2f8a432
--- /dev/null
+++ b/actionview/test/fixtures/test/_two.html.erb
@@ -0,0 +1 @@
+Hello
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/_utf8_partial.html.erb b/actionview/test/fixtures/test/_utf8_partial.html.erb
new file mode 100644
index 0000000000..8d717fd427
--- /dev/null
+++ b/actionview/test/fixtures/test/_utf8_partial.html.erb
@@ -0,0 +1 @@
+<%= "текст" %>
diff --git a/actionview/test/fixtures/test/_utf8_partial_magic.html.erb b/actionview/test/fixtures/test/_utf8_partial_magic.html.erb
new file mode 100644
index 0000000000..4e2224610a
--- /dev/null
+++ b/actionview/test/fixtures/test/_utf8_partial_magic.html.erb
@@ -0,0 +1,2 @@
+<%# encoding: utf-8 -%>
+<%= "текст" %>
diff --git a/actionview/test/fixtures/test/action_talk_to_layout.erb b/actionview/test/fixtures/test/action_talk_to_layout.erb
new file mode 100644
index 0000000000..36e896daa8
--- /dev/null
+++ b/actionview/test/fixtures/test/action_talk_to_layout.erb
@@ -0,0 +1,2 @@
+<% @title = "Talking to the layout" -%>
+Action was here!
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/basic.html.erb b/actionview/test/fixtures/test/basic.html.erb
new file mode 100644
index 0000000000..ea696d7e01
--- /dev/null
+++ b/actionview/test/fixtures/test/basic.html.erb
@@ -0,0 +1 @@
+Hello from basic.html.erb
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/calling_partial_with_layout.html.erb b/actionview/test/fixtures/test/calling_partial_with_layout.html.erb
new file mode 100644
index 0000000000..ac44bc0d81
--- /dev/null
+++ b/actionview/test/fixtures/test/calling_partial_with_layout.html.erb
@@ -0,0 +1 @@
+<%= render(:layout => "layout_for_partial", :partial => "partial_for_use_in_layout", :locals => { :name => "David" }) %>
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/capturing.erb b/actionview/test/fixtures/test/capturing.erb
new file mode 100644
index 0000000000..1addaa40d9
--- /dev/null
+++ b/actionview/test/fixtures/test/capturing.erb
@@ -0,0 +1,4 @@
+<% days = capture do %>
+ Dreamy days
+<% end %>
+<%= days %>
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/change_priority.html.erb b/actionview/test/fixtures/test/change_priority.html.erb
new file mode 100644
index 0000000000..5618977d05
--- /dev/null
+++ b/actionview/test/fixtures/test/change_priority.html.erb
@@ -0,0 +1,2 @@
+<%= render :partial => "test/json_change_priority", formats: :json %>
+HTML Template, but <%= render :partial => "test/changing_priority" %> partial
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/content_for.erb b/actionview/test/fixtures/test/content_for.erb
new file mode 100644
index 0000000000..1fb829f54c
--- /dev/null
+++ b/actionview/test/fixtures/test/content_for.erb
@@ -0,0 +1 @@
+<% content_for :title do -%>Putting stuff in the title!<% end -%>Great stuff!
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/content_for_concatenated.erb b/actionview/test/fixtures/test/content_for_concatenated.erb
new file mode 100644
index 0000000000..e65f629574
--- /dev/null
+++ b/actionview/test/fixtures/test/content_for_concatenated.erb
@@ -0,0 +1,3 @@
+<% content_for :title, "Putting stuff "
+ content_for :title, "in the title!" -%>
+Great stuff!
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/content_for_with_parameter.erb b/actionview/test/fixtures/test/content_for_with_parameter.erb
new file mode 100644
index 0000000000..aeb6f73ce0
--- /dev/null
+++ b/actionview/test/fixtures/test/content_for_with_parameter.erb
@@ -0,0 +1,2 @@
+<% content_for :title, "Putting stuff in the title!" -%>
+Great stuff!
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/dont_pick_me b/actionview/test/fixtures/test/dont_pick_me
new file mode 100644
index 0000000000..0157c9e503
--- /dev/null
+++ b/actionview/test/fixtures/test/dont_pick_me
@@ -0,0 +1 @@
+non-template file
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/dot.directory/render_file_with_ivar.erb b/actionview/test/fixtures/test/dot.directory/render_file_with_ivar.erb
new file mode 100644
index 0000000000..8b8a449236
--- /dev/null
+++ b/actionview/test/fixtures/test/dot.directory/render_file_with_ivar.erb
@@ -0,0 +1 @@
+The secret is <%= @secret %>
diff --git a/actionview/test/fixtures/test/formatted_html_erb.html.erb b/actionview/test/fixtures/test/formatted_html_erb.html.erb
new file mode 100644
index 0000000000..1c64efabd8
--- /dev/null
+++ b/actionview/test/fixtures/test/formatted_html_erb.html.erb
@@ -0,0 +1 @@
+formatted html erb
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/formatted_xml_erb.builder b/actionview/test/fixtures/test/formatted_xml_erb.builder
new file mode 100644
index 0000000000..14fd3549fb
--- /dev/null
+++ b/actionview/test/fixtures/test/formatted_xml_erb.builder
@@ -0,0 +1 @@
+xml.test 'failed'
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/formatted_xml_erb.html.erb b/actionview/test/fixtures/test/formatted_xml_erb.html.erb
new file mode 100644
index 0000000000..0c855a604b
--- /dev/null
+++ b/actionview/test/fixtures/test/formatted_xml_erb.html.erb
@@ -0,0 +1 @@
+passed formatted html erb
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/formatted_xml_erb.xml.erb b/actionview/test/fixtures/test/formatted_xml_erb.xml.erb
new file mode 100644
index 0000000000..6ca09d5304
--- /dev/null
+++ b/actionview/test/fixtures/test/formatted_xml_erb.xml.erb
@@ -0,0 +1 @@
+passed formatted xml erb
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/greeting.html.erb b/actionview/test/fixtures/test/greeting.html.erb
new file mode 100644
index 0000000000..62fb0293f0
--- /dev/null
+++ b/actionview/test/fixtures/test/greeting.html.erb
@@ -0,0 +1 @@
+
This is grand!
diff --git a/actionview/test/fixtures/test/greeting.xml.erb b/actionview/test/fixtures/test/greeting.xml.erb
new file mode 100644
index 0000000000..62fb0293f0
--- /dev/null
+++ b/actionview/test/fixtures/test/greeting.xml.erb
@@ -0,0 +1 @@
+
This is grand!
diff --git a/actionview/test/fixtures/test/hello,world.erb b/actionview/test/fixtures/test/hello,world.erb
new file mode 100644
index 0000000000..bc8fa5e0ca
--- /dev/null
+++ b/actionview/test/fixtures/test/hello,world.erb
@@ -0,0 +1 @@
+Hello w*rld!
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/hello.builder b/actionview/test/fixtures/test/hello.builder
new file mode 100644
index 0000000000..a471553941
--- /dev/null
+++ b/actionview/test/fixtures/test/hello.builder
@@ -0,0 +1,4 @@
+xml.html do
+ xml.p "Hello #{@name}"
+ xml << render(:file => "test/greeting")
+end
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/hello/hello.erb b/actionview/test/fixtures/test/hello/hello.erb
new file mode 100644
index 0000000000..6769dd60bd
--- /dev/null
+++ b/actionview/test/fixtures/test/hello/hello.erb
@@ -0,0 +1 @@
+Hello world!
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/hello_world.da.html.erb b/actionview/test/fixtures/test/hello_world.da.html.erb
new file mode 100644
index 0000000000..10ec443291
--- /dev/null
+++ b/actionview/test/fixtures/test/hello_world.da.html.erb
@@ -0,0 +1 @@
+Hey verden
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/hello_world.erb b/actionview/test/fixtures/test/hello_world.erb
new file mode 100644
index 0000000000..6769dd60bd
--- /dev/null
+++ b/actionview/test/fixtures/test/hello_world.erb
@@ -0,0 +1 @@
+Hello world!
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/hello_world.pt-BR.html.erb b/actionview/test/fixtures/test/hello_world.pt-BR.html.erb
new file mode 100644
index 0000000000..773b3c8c6e
--- /dev/null
+++ b/actionview/test/fixtures/test/hello_world.pt-BR.html.erb
@@ -0,0 +1 @@
+Ola mundo
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/hello_world_container.builder b/actionview/test/fixtures/test/hello_world_container.builder
new file mode 100644
index 0000000000..e48d75c405
--- /dev/null
+++ b/actionview/test/fixtures/test/hello_world_container.builder
@@ -0,0 +1,3 @@
+xml.test do
+ render :partial => 'hello', :locals => { :xm => xml }
+end
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/hello_world_from_rxml.builder b/actionview/test/fixtures/test/hello_world_from_rxml.builder
new file mode 100644
index 0000000000..619a97ba96
--- /dev/null
+++ b/actionview/test/fixtures/test/hello_world_from_rxml.builder
@@ -0,0 +1,3 @@
+xml.html do
+ xml.p "Hello"
+end
diff --git a/actionview/test/fixtures/test/hello_world_with_layout_false.erb b/actionview/test/fixtures/test/hello_world_with_layout_false.erb
new file mode 100644
index 0000000000..6769dd60bd
--- /dev/null
+++ b/actionview/test/fixtures/test/hello_world_with_layout_false.erb
@@ -0,0 +1 @@
+Hello world!
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/hello_world_with_partial.html.erb b/actionview/test/fixtures/test/hello_world_with_partial.html.erb
new file mode 100644
index 0000000000..ec31545356
--- /dev/null
+++ b/actionview/test/fixtures/test/hello_world_with_partial.html.erb
@@ -0,0 +1,2 @@
+Hello world!
+<%= render '/test/partial' %>
diff --git a/actionview/test/fixtures/test/hello_xml_world.builder b/actionview/test/fixtures/test/hello_xml_world.builder
new file mode 100644
index 0000000000..e7081b89fe
--- /dev/null
+++ b/actionview/test/fixtures/test/hello_xml_world.builder
@@ -0,0 +1,11 @@
+xml.html do
+ xml.head do
+ xml.title "Hello World"
+ end
+
+ xml.body do
+ xml.p "abes"
+ xml.p "monks"
+ xml.p "wiseguys"
+ end
+end
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/html_template.html.erb b/actionview/test/fixtures/test/html_template.html.erb
new file mode 100644
index 0000000000..1bbc2b7f09
--- /dev/null
+++ b/actionview/test/fixtures/test/html_template.html.erb
@@ -0,0 +1 @@
+<%= render :partial => "test/first_json_partial", formats: :json %>
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/hyphen-ated.erb b/actionview/test/fixtures/test/hyphen-ated.erb
new file mode 100644
index 0000000000..cd0875583a
--- /dev/null
+++ b/actionview/test/fixtures/test/hyphen-ated.erb
@@ -0,0 +1 @@
+Hello world!
diff --git a/actionview/test/fixtures/test/implicit_content_type.atom.builder b/actionview/test/fixtures/test/implicit_content_type.atom.builder
new file mode 100644
index 0000000000..2fcb32d247
--- /dev/null
+++ b/actionview/test/fixtures/test/implicit_content_type.atom.builder
@@ -0,0 +1,2 @@
+xml.atom do
+end
diff --git a/actionview/test/fixtures/test/layout_render_file.erb b/actionview/test/fixtures/test/layout_render_file.erb
new file mode 100644
index 0000000000..2f8e921c5f
--- /dev/null
+++ b/actionview/test/fixtures/test/layout_render_file.erb
@@ -0,0 +1,2 @@
+<% content_for :title do %>title<% end -%>
+<%= render :file => 'layouts/yield' -%>
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/layout_render_object.erb b/actionview/test/fixtures/test/layout_render_object.erb
new file mode 100644
index 0000000000..acc4453c08
--- /dev/null
+++ b/actionview/test/fixtures/test/layout_render_object.erb
@@ -0,0 +1 @@
+<%= render :layout => "layouts/customers" do |customer| %><%= customer.name %><% end %>
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/list.erb b/actionview/test/fixtures/test/list.erb
new file mode 100644
index 0000000000..0a4bda58ee
--- /dev/null
+++ b/actionview/test/fixtures/test/list.erb
@@ -0,0 +1 @@
+<%= @test_unchanged = 'goodbye' %><%= render :partial => 'customer', :collection => @customers %><%= @test_unchanged %>
diff --git a/actionview/test/fixtures/test/nested_layout.erb b/actionview/test/fixtures/test/nested_layout.erb
new file mode 100644
index 0000000000..6078f74b4c
--- /dev/null
+++ b/actionview/test/fixtures/test/nested_layout.erb
@@ -0,0 +1,3 @@
+<% content_for :title, "title" -%>
+<% content_for :column do -%>column<% end -%>
+<%= render :layout => 'layouts/column' do -%>content<% end -%>
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/nested_streaming.erb b/actionview/test/fixtures/test/nested_streaming.erb
new file mode 100644
index 0000000000..55525e0c92
--- /dev/null
+++ b/actionview/test/fixtures/test/nested_streaming.erb
@@ -0,0 +1,3 @@
+<%- content_for :header do -%>?<%- end -%>
+<%= render :template => "test/streaming" %>
+?
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/non_erb_block_content_for.builder b/actionview/test/fixtures/test/non_erb_block_content_for.builder
new file mode 100644
index 0000000000..d539a425a4
--- /dev/null
+++ b/actionview/test/fixtures/test/non_erb_block_content_for.builder
@@ -0,0 +1,4 @@
+content_for :title do
+ 'Putting stuff in the title!'
+end
+xml << "Great stuff!"
diff --git a/actionview/test/fixtures/test/one.html.erb b/actionview/test/fixtures/test/one.html.erb
new file mode 100644
index 0000000000..0151874809
--- /dev/null
+++ b/actionview/test/fixtures/test/one.html.erb
@@ -0,0 +1 @@
+<%= render :partial => "test/two" %> world
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/potential_conflicts.erb b/actionview/test/fixtures/test/potential_conflicts.erb
new file mode 100644
index 0000000000..a5e964e359
--- /dev/null
+++ b/actionview/test/fixtures/test/potential_conflicts.erb
@@ -0,0 +1,4 @@
+First: <%= @name %>
+<%= render :partial => "person", :locals => { :name => "Stephan" } -%>
+Fourth: <%= @name %>
+Fifth: <%= name %>
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/proper_block_detection.erb b/actionview/test/fixtures/test/proper_block_detection.erb
new file mode 100644
index 0000000000..b55efbb25d
--- /dev/null
+++ b/actionview/test/fixtures/test/proper_block_detection.erb
@@ -0,0 +1 @@
+<%= @todo %>
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/render_file_from_template.html.erb b/actionview/test/fixtures/test/render_file_from_template.html.erb
new file mode 100644
index 0000000000..fde9f4bb64
--- /dev/null
+++ b/actionview/test/fixtures/test/render_file_from_template.html.erb
@@ -0,0 +1 @@
+<%= render :file => @path %>
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/render_file_with_ivar.erb b/actionview/test/fixtures/test/render_file_with_ivar.erb
new file mode 100644
index 0000000000..8b8a449236
--- /dev/null
+++ b/actionview/test/fixtures/test/render_file_with_ivar.erb
@@ -0,0 +1 @@
+The secret is <%= @secret %>
diff --git a/actionview/test/fixtures/test/render_file_with_locals.erb b/actionview/test/fixtures/test/render_file_with_locals.erb
new file mode 100644
index 0000000000..ebe09faee6
--- /dev/null
+++ b/actionview/test/fixtures/test/render_file_with_locals.erb
@@ -0,0 +1 @@
+The secret is <%= secret %>
diff --git a/actionview/test/fixtures/test/render_file_with_locals_and_default.erb b/actionview/test/fixtures/test/render_file_with_locals_and_default.erb
new file mode 100644
index 0000000000..9b4900acc5
--- /dev/null
+++ b/actionview/test/fixtures/test/render_file_with_locals_and_default.erb
@@ -0,0 +1 @@
+<%= secret ||= 'one' %>
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/render_implicit_html_template_from_xhr_request.da.html.erb b/actionview/test/fixtures/test/render_implicit_html_template_from_xhr_request.da.html.erb
new file mode 100644
index 0000000000..0740b2d07c
--- /dev/null
+++ b/actionview/test/fixtures/test/render_implicit_html_template_from_xhr_request.da.html.erb
@@ -0,0 +1 @@
+Hey HTML!
diff --git a/actionview/test/fixtures/test/render_implicit_html_template_from_xhr_request.html.erb b/actionview/test/fixtures/test/render_implicit_html_template_from_xhr_request.html.erb
new file mode 100644
index 0000000000..4a11845cfe
--- /dev/null
+++ b/actionview/test/fixtures/test/render_implicit_html_template_from_xhr_request.html.erb
@@ -0,0 +1 @@
+Hello HTML!
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/render_implicit_js_template_without_layout.js.erb b/actionview/test/fixtures/test/render_implicit_js_template_without_layout.js.erb
new file mode 100644
index 0000000000..892ae5eca2
--- /dev/null
+++ b/actionview/test/fixtures/test/render_implicit_js_template_without_layout.js.erb
@@ -0,0 +1 @@
+alert('hello');
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/render_partial_inside_directory.html.erb b/actionview/test/fixtures/test/render_partial_inside_directory.html.erb
new file mode 100644
index 0000000000..1461b95186
--- /dev/null
+++ b/actionview/test/fixtures/test/render_partial_inside_directory.html.erb
@@ -0,0 +1 @@
+<%= render partial: 'test/_directory/partial_with_locales', locals: {'name' => 'Jane'} %>
diff --git a/actionview/test/fixtures/test/render_to_string_test.erb b/actionview/test/fixtures/test/render_to_string_test.erb
new file mode 100644
index 0000000000..6e267e8634
--- /dev/null
+++ b/actionview/test/fixtures/test/render_to_string_test.erb
@@ -0,0 +1 @@
+The value of foo is: ::<%= @foo %>::
diff --git a/actionview/test/fixtures/test/render_two_partials.html.erb b/actionview/test/fixtures/test/render_two_partials.html.erb
new file mode 100644
index 0000000000..3db6025860
--- /dev/null
+++ b/actionview/test/fixtures/test/render_two_partials.html.erb
@@ -0,0 +1,2 @@
+<%= render :partial => 'partial', :locals => {'first' => '1'} %>
+<%= render :partial => 'partial', :locals => {'second' => '2'} %>
diff --git a/actionview/test/fixtures/test/streaming.erb b/actionview/test/fixtures/test/streaming.erb
new file mode 100644
index 0000000000..fb9b8b1ade
--- /dev/null
+++ b/actionview/test/fixtures/test/streaming.erb
@@ -0,0 +1,3 @@
+<%- provide :header do -%>Yes, <%- end -%>
+this works
+<%- content_for :footer, " like a charm" -%>
diff --git a/actionview/test/fixtures/test/streaming_buster.erb b/actionview/test/fixtures/test/streaming_buster.erb
new file mode 100644
index 0000000000..4221d56dcc
--- /dev/null
+++ b/actionview/test/fixtures/test/streaming_buster.erb
@@ -0,0 +1,3 @@
+<%= yield :foo -%>
+This won't look
+<% provide :unknown, " good." -%>
diff --git a/actionview/test/fixtures/test/sub_template_raise.html.erb b/actionview/test/fixtures/test/sub_template_raise.html.erb
new file mode 100644
index 0000000000..f38c0bda90
--- /dev/null
+++ b/actionview/test/fixtures/test/sub_template_raise.html.erb
@@ -0,0 +1 @@
+<%= render :partial => "test/raise" %>
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/template.erb b/actionview/test/fixtures/test/template.erb
new file mode 100644
index 0000000000..785afa8f6a
--- /dev/null
+++ b/actionview/test/fixtures/test/template.erb
@@ -0,0 +1 @@
+<%= template.path %>
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/update_element_with_capture.erb b/actionview/test/fixtures/test/update_element_with_capture.erb
new file mode 100644
index 0000000000..fa3ef200f9
--- /dev/null
+++ b/actionview/test/fixtures/test/update_element_with_capture.erb
@@ -0,0 +1,9 @@
+<% replacement_function = update_element_function("products", :action => :update) do %>
+
Product 1
+
Product 2
+<% end %>
+<%= javascript_tag(replacement_function) %>
+
+<% update_element_function("status", :action => :update, :binding => binding) do %>
+ You bought something!
+<% end %>
diff --git a/actionview/test/fixtures/test/using_layout_around_block.html.erb b/actionview/test/fixtures/test/using_layout_around_block.html.erb
new file mode 100644
index 0000000000..3d6661df9a
--- /dev/null
+++ b/actionview/test/fixtures/test/using_layout_around_block.html.erb
@@ -0,0 +1 @@
+<%= render(:layout => "layout_for_partial", :locals => { :name => "David" }) do %>Inside from block<% end %>
\ No newline at end of file
diff --git a/actionview/test/fixtures/test/utf8.html.erb b/actionview/test/fixtures/test/utf8.html.erb
new file mode 100644
index 0000000000..ac98c2f012
--- /dev/null
+++ b/actionview/test/fixtures/test/utf8.html.erb
@@ -0,0 +1,4 @@
+Русский <%= render :partial => 'test/utf8_partial' %>
+<%= "日".encoding %>
+<%= @output_buffer.encoding %>
+<%= __ENCODING__ %>
diff --git a/actionview/test/fixtures/test/utf8_magic.html.erb b/actionview/test/fixtures/test/utf8_magic.html.erb
new file mode 100644
index 0000000000..257279c29f
--- /dev/null
+++ b/actionview/test/fixtures/test/utf8_magic.html.erb
@@ -0,0 +1,5 @@
+<%# encoding: utf-8 -%>
+Русский <%= render :partial => 'test/utf8_partial_magic' %>
+<%= "日".encoding %>
+<%= @output_buffer.encoding %>
+<%= __ENCODING__ %>
diff --git a/actionview/test/fixtures/test/utf8_magic_with_bare_partial.html.erb b/actionview/test/fixtures/test/utf8_magic_with_bare_partial.html.erb
new file mode 100644
index 0000000000..cb22692f9a
--- /dev/null
+++ b/actionview/test/fixtures/test/utf8_magic_with_bare_partial.html.erb
@@ -0,0 +1,5 @@
+<%# encoding: utf-8 -%>
+Русский <%= render :partial => 'test/utf8_partial' %>
+<%= "日".encoding %>
+<%= @output_buffer.encoding %>
+<%= __ENCODING__ %>
diff --git a/actionview/test/fixtures/test/with_html_partial.html.erb b/actionview/test/fixtures/test/with_html_partial.html.erb
new file mode 100644
index 0000000000..d84d909d64
--- /dev/null
+++ b/actionview/test/fixtures/test/with_html_partial.html.erb
@@ -0,0 +1 @@
+<%= render :partial => "partial_only_html" %>
diff --git a/actionview/test/fixtures/test/with_partial.html.erb b/actionview/test/fixtures/test/with_partial.html.erb
new file mode 100644
index 0000000000..7502364cf5
--- /dev/null
+++ b/actionview/test/fixtures/test/with_partial.html.erb
@@ -0,0 +1 @@
+<%= render :partial => "partial_only" %>
diff --git a/actionview/test/fixtures/test/with_partial.text.erb b/actionview/test/fixtures/test/with_partial.text.erb
new file mode 100644
index 0000000000..5f068ebf27
--- /dev/null
+++ b/actionview/test/fixtures/test/with_partial.text.erb
@@ -0,0 +1 @@
+**<%= render :partial => "partial_only" %>**
diff --git a/actionview/test/fixtures/test/with_xml_template.html.erb b/actionview/test/fixtures/test/with_xml_template.html.erb
new file mode 100644
index 0000000000..e54a7cd001
--- /dev/null
+++ b/actionview/test/fixtures/test/with_xml_template.html.erb
@@ -0,0 +1 @@
+<%= render :template => "test/greeting", :formats => :xml %>
diff --git a/actionview/test/fixtures/topic.rb b/actionview/test/fixtures/topic.rb
new file mode 100644
index 0000000000..9fa9746535
--- /dev/null
+++ b/actionview/test/fixtures/topic.rb
@@ -0,0 +1,3 @@
+class Topic < ActiveRecord::Base
+ has_many :replies, :dependent => :destroy
+end
diff --git a/actionview/test/fixtures/topics.yml b/actionview/test/fixtures/topics.yml
new file mode 100644
index 0000000000..7fdd49d54e
--- /dev/null
+++ b/actionview/test/fixtures/topics.yml
@@ -0,0 +1,22 @@
+futurama:
+ id: 1
+ title: Isnt futurama awesome?
+ subtitle: It really is, isnt it.
+ content: I like futurama
+ created_at: <%= 1.day.ago.to_s(:db) %>
+ updated_at:
+
+harvey_birdman:
+ id: 2
+ title: Harvey Birdman is the king of all men
+ subtitle: yup
+ content: It really is
+ created_at: <%= 2.hours.ago.to_s(:db) %>
+ updated_at:
+
+rails:
+ id: 3
+ title: Rails is nice
+ subtitle: It makes me happy
+ content: except when I have to hack internals to fix pagination. even then really.
+ created_at: <%= 20.minutes.ago.to_s(:db) %>
diff --git a/actionview/test/fixtures/topics/_topic.html.erb b/actionview/test/fixtures/topics/_topic.html.erb
new file mode 100644
index 0000000000..98659ca098
--- /dev/null
+++ b/actionview/test/fixtures/topics/_topic.html.erb
@@ -0,0 +1 @@
+<%= topic.title %>
\ No newline at end of file
diff --git a/actionview/test/fixtures/translations/templates/array.erb b/actionview/test/fixtures/translations/templates/array.erb
new file mode 100644
index 0000000000..d86045a172
--- /dev/null
+++ b/actionview/test/fixtures/translations/templates/array.erb
@@ -0,0 +1 @@
+<%= t('.foo.bar') %>
diff --git a/actionview/test/fixtures/translations/templates/default.erb b/actionview/test/fixtures/translations/templates/default.erb
new file mode 100644
index 0000000000..8b70031071
--- /dev/null
+++ b/actionview/test/fixtures/translations/templates/default.erb
@@ -0,0 +1 @@
+<%= t('.missing', :default => :'.foo') %>
diff --git a/actionview/test/fixtures/translations/templates/found.erb b/actionview/test/fixtures/translations/templates/found.erb
new file mode 100644
index 0000000000..080c9c0aee
--- /dev/null
+++ b/actionview/test/fixtures/translations/templates/found.erb
@@ -0,0 +1 @@
+<%= t('.foo') %>
diff --git a/actionview/test/fixtures/translations/templates/missing.erb b/actionview/test/fixtures/translations/templates/missing.erb
new file mode 100644
index 0000000000..0f3f17f8ef
--- /dev/null
+++ b/actionview/test/fixtures/translations/templates/missing.erb
@@ -0,0 +1 @@
+<%= t('.missing') %>
diff --git a/actionview/test/fixtures/with_format.json.erb b/actionview/test/fixtures/with_format.json.erb
new file mode 100644
index 0000000000..a7f480ab1d
--- /dev/null
+++ b/actionview/test/fixtures/with_format.json.erb
@@ -0,0 +1 @@
+<%= render :partial => 'missing', :formats => [:json] %>
diff --git a/actionview/test/lib/controller/fake_controllers.rb b/actionview/test/lib/controller/fake_controllers.rb
new file mode 100644
index 0000000000..1a2863b689
--- /dev/null
+++ b/actionview/test/lib/controller/fake_controllers.rb
@@ -0,0 +1,35 @@
+class ContentController < ActionController::Base; end
+
+module Admin
+ class AccountsController < ActionController::Base; end
+ class PostsController < ActionController::Base; end
+ class StuffController < ActionController::Base; end
+ class UserController < ActionController::Base; end
+ class UsersController < ActionController::Base; end
+end
+
+module Api
+ class UsersController < ActionController::Base; end
+ class ProductsController < ActionController::Base; end
+end
+
+class AccountController < ActionController::Base; end
+class ArchiveController < ActionController::Base; end
+class ArticlesController < ActionController::Base; end
+class BarController < ActionController::Base; end
+class BlogController < ActionController::Base; end
+class BooksController < ActionController::Base; end
+class CarsController < ActionController::Base; end
+class CcController < ActionController::Base; end
+class CController < ActionController::Base; end
+class FooController < ActionController::Base; end
+class GeocodeController < ActionController::Base; end
+class NewsController < ActionController::Base; end
+class NotesController < ActionController::Base; end
+class PagesController < ActionController::Base; end
+class PeopleController < ActionController::Base; end
+class PostsController < ActionController::Base; end
+class SubpathBooksController < ActionController::Base; end
+class SymbolsController < ActionController::Base; end
+class UserController < ActionController::Base; end
+class UsersController < ActionController::Base; end
diff --git a/actionview/test/lib/controller/fake_models.rb b/actionview/test/lib/controller/fake_models.rb
new file mode 100644
index 0000000000..82f38b5309
--- /dev/null
+++ b/actionview/test/lib/controller/fake_models.rb
@@ -0,0 +1,219 @@
+require "active_model"
+
+class Customer < Struct.new(:name, :id)
+ extend ActiveModel::Naming
+ include ActiveModel::Conversion
+
+ undef_method :to_json
+
+ def to_xml(options={})
+ if options[:builder]
+ options[:builder].name name
+ else
+ "#{name}"
+ end
+ end
+
+ def to_js(options={})
+ "name: #{name.inspect}"
+ end
+ alias :to_text :to_js
+
+ def errors
+ []
+ end
+
+ def persisted?
+ id.present?
+ end
+end
+
+class BadCustomer < Customer
+end
+
+class GoodCustomer < Customer
+end
+
+class ValidatedCustomer < Customer
+ def errors
+ if name =~ /Sikachu/i
+ []
+ else
+ [{:name => "is invalid"}]
+ end
+ end
+end
+
+module Quiz
+ class Question < Struct.new(:name, :id)
+ extend ActiveModel::Naming
+ include ActiveModel::Conversion
+
+ def persisted?
+ id.present?
+ end
+ end
+
+ class Store < Question
+ end
+end
+
+class Post < Struct.new(:title, :author_name, :body, :secret, :persisted, :written_on, :cost)
+ extend ActiveModel::Naming
+ include ActiveModel::Conversion
+ extend ActiveModel::Translation
+
+ alias_method :secret?, :secret
+ alias_method :persisted?, :persisted
+
+ def initialize(*args)
+ super
+ @persisted = false
+ end
+
+ attr_accessor :author
+ def author_attributes=(attributes); end
+
+ attr_accessor :comments, :comment_ids
+ def comments_attributes=(attributes); end
+
+ attr_accessor :tags
+ def tags_attributes=(attributes); end
+end
+
+class Comment
+ extend ActiveModel::Naming
+ include ActiveModel::Conversion
+
+ attr_reader :id
+ attr_reader :post_id
+ def initialize(id = nil, post_id = nil); @id, @post_id = id, post_id end
+ def to_key; id ? [id] : nil end
+ def save; @id = 1; @post_id = 1 end
+ def persisted?; @id.present? end
+ def to_param; @id.to_s; end
+ def name
+ @id.nil? ? "new #{self.class.name.downcase}" : "#{self.class.name.downcase} ##{@id}"
+ end
+
+ attr_accessor :relevances
+ def relevances_attributes=(attributes); end
+
+ attr_accessor :body
+end
+
+class Tag
+ extend ActiveModel::Naming
+ include ActiveModel::Conversion
+
+ attr_reader :id
+ attr_reader :post_id
+ def initialize(id = nil, post_id = nil); @id, @post_id = id, post_id end
+ def to_key; id ? [id] : nil end
+ def save; @id = 1; @post_id = 1 end
+ def persisted?; @id.present? end
+ def to_param; @id; end
+ def value
+ @id.nil? ? "new #{self.class.name.downcase}" : "#{self.class.name.downcase} ##{@id}"
+ end
+
+ attr_accessor :relevances
+ def relevances_attributes=(attributes); end
+
+end
+
+class CommentRelevance
+ extend ActiveModel::Naming
+ include ActiveModel::Conversion
+
+ attr_reader :id
+ attr_reader :comment_id
+ def initialize(id = nil, comment_id = nil); @id, @comment_id = id, comment_id end
+ def to_key; id ? [id] : nil end
+ def save; @id = 1; @comment_id = 1 end
+ def persisted?; @id.present? end
+ def to_param; @id; end
+ def value
+ @id.nil? ? "new #{self.class.name.downcase}" : "#{self.class.name.downcase} ##{@id}"
+ end
+end
+
+class Sheep
+ extend ActiveModel::Naming
+ include ActiveModel::Conversion
+
+ attr_reader :id
+ def to_key; id ? [id] : nil end
+ def save; @id = 1 end
+ def new_record?; @id.nil? end
+ def name
+ @id.nil? ? 'new sheep' : "sheep ##{@id}"
+ end
+end
+
+
+class TagRelevance
+ extend ActiveModel::Naming
+ include ActiveModel::Conversion
+
+ attr_reader :id
+ attr_reader :tag_id
+ def initialize(id = nil, tag_id = nil); @id, @tag_id = id, tag_id end
+ def to_key; id ? [id] : nil end
+ def save; @id = 1; @tag_id = 1 end
+ def persisted?; @id.present? end
+ def to_param; @id; end
+ def value
+ @id.nil? ? "new #{self.class.name.downcase}" : "#{self.class.name.downcase} ##{@id}"
+ end
+end
+
+class Author < Comment
+ attr_accessor :post
+ def post_attributes=(attributes); end
+end
+
+class HashBackedAuthor < Hash
+ extend ActiveModel::Naming
+ include ActiveModel::Conversion
+
+ def persisted?; false; end
+
+ def name
+ "hash backed author"
+ end
+end
+
+module Blog
+ def self.use_relative_model_naming?
+ true
+ end
+
+ class Post < Struct.new(:title, :id)
+ extend ActiveModel::Naming
+ include ActiveModel::Conversion
+
+ def persisted?
+ id.present?
+ end
+ end
+end
+
+class ArelLike
+ def to_ary
+ true
+ end
+ def each
+ a = Array.new(2) { |id| Comment.new(id + 1) }
+ a.each { |i| yield i }
+ end
+end
+
+class RenderJsonTestException < Exception
+ def to_json(options = nil)
+ return { :error => self.class.name, :message => self.to_s }.to_json
+ end
+end
+
+class Car < Struct.new(:color)
+end
diff --git a/actionview/test/template/active_model_helper_test.rb b/actionview/test/template/active_model_helper_test.rb
new file mode 100644
index 0000000000..86bccdfade
--- /dev/null
+++ b/actionview/test/template/active_model_helper_test.rb
@@ -0,0 +1,99 @@
+require 'abstract_unit'
+
+class ActiveModelHelperTest < ActionView::TestCase
+ tests ActionView::Helpers::ActiveModelHelper
+
+ silence_warnings do
+ class Post < Struct.new(:author_name, :body, :updated_at)
+ include ActiveModel::Conversion
+ include ActiveModel::Validations
+
+ def persisted?
+ false
+ end
+ end
+ end
+
+ def setup
+ super
+
+ @post = Post.new
+ @post.errors[:author_name] << "can't be empty"
+ @post.errors[:body] << "foo"
+ @post.errors[:updated_at] << "bar"
+
+ @post.author_name = ""
+ @post.body = "Back to the hill and over it again!"
+ @post.updated_at = Date.new(2004, 6, 15)
+ end
+
+ def test_text_area_with_errors
+ assert_dom_equal(
+ %(),
+ text_area("post", "body")
+ )
+ end
+
+ def test_text_field_with_errors
+ assert_dom_equal(
+ %(),
+ text_field("post", "author_name")
+ )
+ end
+
+ def test_select_with_errors
+ assert_dom_equal(
+ %(),
+ select("post", "author_name", [:a, :b])
+ )
+ end
+
+ def test_select_with_errors_and_blank_option
+ expected_dom = %()
+ assert_dom_equal(expected_dom, select("post", "author_name", [:a, :b], :include_blank => 'Choose one...'))
+ assert_dom_equal(expected_dom, select("post", "author_name", [:a, :b], :prompt => 'Choose one...'))
+ end
+
+ def test_date_select_with_errors
+ assert_dom_equal(
+ %(
"))
+ assert_equal("Weirdos", sanitizer.sanitize("Wei<a onclick='alert(document.cookie);'/>rdos"))
+ assert_equal("This is a test.", sanitizer.sanitize("This is a test."))
+ assert_equal(
+ %{This is a test.\n\n\nIt no longer contains any HTML.\n}, sanitizer.sanitize(
+ %{This is a test.\n\n\n\n
It no longer contains any HTML.
\n}))
+ assert_equal "This has a here.", sanitizer.sanitize("This has a here.")
+ assert_equal "This has a here.", sanitizer.sanitize("This has a ]]> here.")
+ assert_equal "This has an unclosed ", sanitizer.sanitize("This has an unclosed ]] here...")
+ [nil, '', ' '].each { |blank| assert_equal blank, sanitizer.sanitize(blank) }
+ assert_nothing_raised { sanitizer.sanitize("This is a frozen string with no tags".freeze) }
+ end
+
+ def test_strip_links
+ sanitizer = HTML::LinkSanitizer.new
+ assert_equal "Dont touch me", sanitizer.sanitize("Dont touch me")
+ assert_equal "on my mind\nall day long", sanitizer.sanitize("on my mind\nall day long")
+ assert_equal "0wn3d", sanitizer.sanitize("0wn3d")
+ assert_equal "Magic", sanitizer.sanitize("Magic")
+ assert_equal "FrrFox", sanitizer.sanitize("FrrFox")
+ assert_equal "My mind\nall day long", sanitizer.sanitize("My mind\nall day long")
+ assert_equal "all day long", sanitizer.sanitize("<a href='hello'>all day long</a>")
+
+ assert_equal "", ''
+ end
+
+ def test_sanitize_plaintext
+ raw = "foo"
+ assert_sanitized raw, "foo"
+ end
+
+ def test_sanitize_script
+ assert_sanitized "a b cd e f", "a b cd e f"
+ end
+
+ def test_sanitize_js_handlers
+ raw = %{onthis="do that" hello}
+ assert_sanitized raw, %{onthis="do that" hello}
+ end
+
+ def test_sanitize_javascript_href
+ raw = %{href="javascript:bang" foo, bar}
+ assert_sanitized raw, %{href="javascript:bang" foo, bar}
+ end
+
+ def test_sanitize_image_src
+ raw = %{src="javascript:bang" foo, bar}
+ assert_sanitized raw, %{src="javascript:bang" foo, bar}
+ end
+
+ HTML::WhiteListSanitizer.allowed_tags.each do |tag_name|
+ define_method "test_should_allow_#{tag_name}_tag" do
+ assert_sanitized "start <#{tag_name} title=\"1\" onclick=\"foo\">foo bar baz#{tag_name}> end", %(start <#{tag_name} title="1">foo bar baz#{tag_name}> end)
+ end
+ end
+
+ def test_should_allow_anchors
+ assert_sanitized %(), %()
+ end
+
+ # RFC 3986, sec 4.2
+ def test_allow_colons_in_path_component
+ assert_sanitized("foo")
+ end
+
+ %w(src width height alt).each do |img_attr|
+ define_method "test_should_allow_image_#{img_attr}_attribute" do
+ assert_sanitized %(), %()
+ end
+ end
+
+ def test_should_handle_non_html
+ assert_sanitized 'abc'
+ end
+
+ def test_should_handle_blank_text
+ assert_sanitized nil
+ assert_sanitized ''
+ end
+
+ def test_should_allow_custom_tags
+ text = "foo"
+ sanitizer = HTML::WhiteListSanitizer.new
+ assert_equal(text, sanitizer.sanitize(text, :tags => %w(u)))
+ end
+
+ def test_should_allow_only_custom_tags
+ text = "foo with bar"
+ sanitizer = HTML::WhiteListSanitizer.new
+ assert_equal("foo with bar", sanitizer.sanitize(text, :tags => %w(u)))
+ end
+
+ def test_should_allow_custom_tags_with_attributes
+ text = %(
foo
)
+ sanitizer = HTML::WhiteListSanitizer.new
+ assert_equal(text, sanitizer.sanitize(text))
+ end
+
+ def test_should_allow_custom_tags_with_custom_attributes
+ text = %(
Lorem ipsum
)
+ sanitizer = HTML::WhiteListSanitizer.new
+ assert_equal(text, sanitizer.sanitize(text, :attributes => ['foo']))
+ end
+
+ def test_should_raise_argument_error_if_tags_is_not_enumerable
+ sanitizer = HTML::WhiteListSanitizer.new
+ e = assert_raise(ArgumentError) do
+ sanitizer.sanitize('', :tags => 'foo')
+ end
+
+ assert_equal "You should pass :tags as an Enumerable", e.message
+ end
+
+ def test_should_raise_argument_error_if_attributes_is_not_enumerable
+ sanitizer = HTML::WhiteListSanitizer.new
+ e = assert_raise(ArgumentError) do
+ sanitizer.sanitize('', :attributes => 'foo')
+ end
+
+ assert_equal "You should pass :attributes as an Enumerable", e.message
+ end
+
+ [%w(img src), %w(a href)].each do |(tag, attr)|
+ define_method "test_should_strip_#{attr}_attribute_in_#{tag}_with_bad_protocols" do
+ assert_sanitized %(<#{tag} #{attr}="javascript:bang" title="1">boo#{tag}>), %(<#{tag} title="1">boo#{tag}>)
+ end
+ end
+
+ def test_should_flag_bad_protocols
+ sanitizer = HTML::WhiteListSanitizer.new
+ %w(about chrome data disk hcp help javascript livescript lynxcgi lynxexec ms-help ms-its mhtml mocha opera res resource shell vbscript view-source vnd.ms.radio wysiwyg).each do |proto|
+ assert sanitizer.send(:contains_bad_protocols?, 'src', "#{proto}://bad")
+ end
+ end
+
+ def test_should_accept_good_protocols_ignoring_case
+ sanitizer = HTML::WhiteListSanitizer.new
+ HTML::WhiteListSanitizer.allowed_protocols.each do |proto|
+ assert !sanitizer.send(:contains_bad_protocols?, 'src', "#{proto.capitalize}://good")
+ end
+ end
+
+ def test_should_accept_good_protocols_ignoring_space
+ sanitizer = HTML::WhiteListSanitizer.new
+ HTML::WhiteListSanitizer.allowed_protocols.each do |proto|
+ assert !sanitizer.send(:contains_bad_protocols?, 'src', " #{proto}://good")
+ end
+ end
+
+ def test_should_accept_good_protocols
+ sanitizer = HTML::WhiteListSanitizer.new
+ HTML::WhiteListSanitizer.allowed_protocols.each do |proto|
+ assert !sanitizer.send(:contains_bad_protocols?, 'src', "#{proto}://good")
+ end
+ end
+
+ def test_should_reject_hex_codes_in_protocol
+ assert_sanitized %(1), "1"
+ assert @sanitizer.send(:contains_bad_protocols?, 'src', "%6A%61%76%61%73%63%72%69%70%74%3A%61%6C%65%72%74%28%22%58%53%53%22%29")
+ end
+
+ def test_should_block_script_tag
+ assert_sanitized %(), ""
+ end
+
+ [%(),
+ %(),
+ %(),
+ %(">),
+ %(),
+ %(),
+ %(),
+ %(),
+ %(),
+ %(),
+ %(),
+ %(),
+ %(),
+ %(),
+ %(),
+ %()].each_with_index do |img_hack, i|
+ define_method "test_should_not_fall_for_xss_image_hack_#{i+1}" do
+ assert_sanitized img_hack, ""
+ end
+ end
+
+ def test_should_sanitize_tag_broken_up_by_null
+ assert_sanitized %(alert(\"XSS\")), "alert(\"XSS\")"
+ end
+
+ def test_should_sanitize_invalid_script_tag
+ assert_sanitized %(), ""
+ end
+
+ def test_should_sanitize_script_tag_with_multiple_open_brackets
+ assert_sanitized %(<), "<"
+ assert_sanitized %(