diff options
author | Eileen M. Uchitelle <eileencodes@users.noreply.github.com> | 2019-04-03 13:21:51 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-03 13:21:51 -0400 |
commit | d39b2b684e94e856a4a1257984ff6a1d5f978a2c (patch) | |
tree | 924b846a52d8501a7a78cd84cde0dd411dbcd498 /actionpack/test | |
parent | f960920a8e8501cb5af2504166fe45b867705b88 (diff) | |
parent | eb52904eb5c19ab4e8ff7a7d4f501fe5e1142ad0 (diff) | |
download | rails-d39b2b684e94e856a4a1257984ff6a1d5f978a2c.tar.gz rails-d39b2b684e94e856a4a1257984ff6a1d5f978a2c.tar.bz2 rails-d39b2b684e94e856a4a1257984ff6a1d5f978a2c.zip |
Merge pull request #35825 from jhawthorn/always_filter_view_paths
Make Resolver#find_all_anywhere equivalent to #find_all
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/new_base/render_file_test.rb | 4 | ||||
-rw-r--r-- | actionpack/test/controller/render_test.rb | 17 |
2 files changed, 12 insertions, 9 deletions
diff --git a/actionpack/test/controller/new_base/render_file_test.rb b/actionpack/test/controller/new_base/render_file_test.rb index 82325c5bb2..01d0223519 100644 --- a/actionpack/test/controller/new_base/render_file_test.rb +++ b/actionpack/test/controller/new_base/render_file_test.rb @@ -17,12 +17,12 @@ module RenderFile def relative_path @secret = "in the sauce" - render file: "../../fixtures/test/render_file_with_ivar" + render file: "../actionpack/test/fixtures/test/render_file_with_ivar" end def relative_path_with_dot @secret = "in the sauce" - render file: "../../fixtures/test/dot.directory/render_file_with_ivar" + render file: "../actionpack/test/fixtures/test/dot.directory/render_file_with_ivar" end def pathname diff --git a/actionpack/test/controller/render_test.rb b/actionpack/test/controller/render_test.rb index 6d198ca42f..8bb6617eaa 100644 --- a/actionpack/test/controller/render_test.rb +++ b/actionpack/test/controller/render_test.rb @@ -323,11 +323,12 @@ class ExpiresInRenderTest < ActionController::TestCase end def test_dynamic_render_with_file - # This is extremely bad, but should be possible to do. assert File.exist?(File.expand_path("../../test/abstract_unit.rb", __dir__)) - response = assert_deprecated { get :dynamic_render_with_file, params: { id: '../\\../test/abstract_unit.rb' } } - assert_equal File.read(File.expand_path("../../test/abstract_unit.rb", __dir__)), - response.body + assert_deprecated do + assert_raises ActionView::MissingTemplate do + get :dynamic_render_with_file, params: { id: '../\\../test/abstract_unit.rb' } + end + end end def test_dynamic_render_with_absolute_path @@ -351,9 +352,11 @@ class ExpiresInRenderTest < ActionController::TestCase def test_permitted_dynamic_render_file_hash assert File.exist?(File.expand_path("../../test/abstract_unit.rb", __dir__)) - response = assert_deprecated { get :dynamic_render_permit, params: { id: { file: '../\\../test/abstract_unit.rb' } } } - assert_equal File.read(File.expand_path("../../test/abstract_unit.rb", __dir__)), - response.body + assert_deprecated do + assert_raises ActionView::MissingTemplate do + get :dynamic_render_permit, params: { id: { file: '../\\../test/abstract_unit.rb' } } + end + end end def test_dynamic_render_file_hash |