aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/controller/layout_test.rb19
l---------actionpack/test/fixtures/layout_tests/layouts/symlinked1
-rw-r--r--actionpack/test/fixtures/symlink_parent/symlinked_layout.erb5
-rw-r--r--actionpack/test/template/template_finder_test.rb8
4 files changed, 29 insertions, 4 deletions
diff --git a/actionpack/test/controller/layout_test.rb b/actionpack/test/controller/layout_test.rb
index c8507af532..145543a357 100644
--- a/actionpack/test/controller/layout_test.rb
+++ b/actionpack/test/controller/layout_test.rb
@@ -238,3 +238,22 @@ class LayoutStatusIsRenderedTest < Test::Unit::TestCase
assert_response 401
end
end
+
+class LayoutSymlinkedTest < LayoutTest
+ layout "symlinked/symlinked_layout"
+end
+
+class LayoutSymlinkedIsRenderedTest < Test::Unit::TestCase
+ def setup
+ @request = ActionController::TestRequest.new
+ @response = ActionController::TestResponse.new
+ end
+
+ def test_symlinked_layout_is_rendered
+ @controller = LayoutSymlinkedTest.new
+ get :hello
+ assert_response 200
+ assert_equal "layouts/symlinked/symlinked_layout", @response.layout
+ end
+end
+ \ No newline at end of file
diff --git a/actionpack/test/fixtures/layout_tests/layouts/symlinked b/actionpack/test/fixtures/layout_tests/layouts/symlinked
new file mode 120000
index 0000000000..0ddc1154ab
--- /dev/null
+++ b/actionpack/test/fixtures/layout_tests/layouts/symlinked
@@ -0,0 +1 @@
+../../symlink_parent \ No newline at end of file
diff --git a/actionpack/test/fixtures/symlink_parent/symlinked_layout.erb b/actionpack/test/fixtures/symlink_parent/symlinked_layout.erb
new file mode 100644
index 0000000000..bda57d0fae
--- /dev/null
+++ b/actionpack/test/fixtures/symlink_parent/symlinked_layout.erb
@@ -0,0 +1,5 @@
+This is my layout
+
+<%= yield %>
+
+End.
diff --git a/actionpack/test/template/template_finder_test.rb b/actionpack/test/template/template_finder_test.rb
index 296815f4cb..a162640de3 100644
--- a/actionpack/test/template/template_finder_test.rb
+++ b/actionpack/test/template/template_finder_test.rb
@@ -21,14 +21,14 @@ class TemplateFinderTest < Test::Unit::TestCase
assert_equal ["builder", "erb", "rhtml", "rjs", "rxml", "mab"].sort,
ActionView::TemplateFinder.file_extension_cache[LOAD_PATH_ROOT].values.flatten.uniq.sort
- assert_equal Dir.glob("#{LOAD_PATH_ROOT}/**/*.{erb,rjs,rhtml,builder,rxml,mab}").size,
+ assert_equal Dir.glob("#{LOAD_PATH_ROOT}/**/*/*.{erb,rjs,rhtml,builder,rxml,mab}").size,
ActionView::TemplateFinder.file_extension_cache[LOAD_PATH_ROOT].keys.size
end
def test_should_cache_dir_content_properly
assert ActionView::TemplateFinder.processed_view_paths[LOAD_PATH_ROOT]
- assert_equal Dir.glob("#{LOAD_PATH_ROOT}/**/*").find_all {|f| !File.directory?(f) }.size,
- ActionView::TemplateFinder.processed_view_paths[LOAD_PATH_ROOT].size
+ assert_equal Dir.glob("#{LOAD_PATH_ROOT}/**/*/**").find_all {|f| !File.directory?(f) }.size,
+ ActionView::TemplateFinder.processed_view_paths[LOAD_PATH_ROOT].size
end
def test_find_template_extension_from_first_render
@@ -62,7 +62,7 @@ class TemplateFinderTest < Test::Unit::TestCase
assert_equal false, @finder.send(:file_exists?, 'baz')
assert_equal false, @finder.send(:file_exists?, 'baz.rb')
end
-
+
uses_mocha 'Template finder tests' do
def test_should_update_extension_cache_when_template_handler_is_registered
ActionView::TemplateFinder.expects(:update_extension_cache_for).with("funky")