diff options
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/caching_test.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/actionpack/test/controller/caching_test.rb b/actionpack/test/controller/caching_test.rb index 828b2fbf26..d6982fbc86 100644 --- a/actionpack/test/controller/caching_test.rb +++ b/actionpack/test/controller/caching_test.rb @@ -35,6 +35,10 @@ class PageCachingTestController < ActionController::Base expire_page("/index.html") head :ok end + + def trailing_slash + render :text => "Sneak attack" + end end class PageCachingTest < Test::Unit::TestCase @@ -91,6 +95,16 @@ class PageCachingTest < Test::Unit::TestCase get :expire_custom_path assert !File.exist?("#{FILE_STORE_PATH}/index.html") end + + def test_should_cache_without_trailing_slash_on_url + @controller.class.cache_page 'cached content', '/page_caching_test/trailing_slash' + assert File.exist?("#{FILE_STORE_PATH}/page_caching_test/trailing_slash.html") + end + + def test_should_cache_with_trailing_slash_on_url + @controller.class.cache_page 'cached content', '/page_caching_test/trailing_slash/' + assert File.exist?("#{FILE_STORE_PATH}/page_caching_test/trailing_slash.html") + end uses_mocha("should_cache_ok_at_custom_path") do def test_should_cache_ok_at_custom_path |