From 49d032929b4924a3fc3e43aa21ca90d7f1174724 Mon Sep 17 00:00:00 2001 From: Neeraj Singh Date: Fri, 10 Jun 2011 02:24:37 -0400 Subject: The test name is misleading. It says test_should_cache_with_trailing_slash_on_url A trailing slash is removed when a page is cached. What the test meant to say was : a url with trailing slash should be cached and the cached page should not have any trailing slash. This patch clarifies the name a bit. --- actionpack/test/controller/caching_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actionpack/test/controller/caching_test.rb b/actionpack/test/controller/caching_test.rb index 82c2c23607..dcb88d604d 100644 --- a/actionpack/test/controller/caching_test.rb +++ b/actionpack/test/controller/caching_test.rb @@ -127,7 +127,7 @@ class PageCachingTest < ActionController::TestCase assert_equal 'I am xml', @response.body end - def test_should_cache_with_trailing_slash_on_url + def test_cached_page_should_not_have_trailing_slash_even_if_url_has_trailing_slash @controller.class.cache_page 'cached content', '/page_caching_test/trailing_slash/' assert File.exist?("#{FILE_STORE_PATH}/page_caching_test/trailing_slash.html") end -- cgit v1.2.3 From fdbe8eb08cd227cc57315134e4e253818ccf1b67 Mon Sep 17 00:00:00 2001 From: Neeraj Singh Date: Fri, 10 Jun 2011 02:27:57 -0400 Subject: replaced and with && as per coding guidelines --- actionpack/test/controller/caching_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actionpack/test/controller/caching_test.rb b/actionpack/test/controller/caching_test.rb index dcb88d604d..da3314fe6d 100644 --- a/actionpack/test/controller/caching_test.rb +++ b/actionpack/test/controller/caching_test.rb @@ -141,7 +141,7 @@ class PageCachingTest < ActionController::TestCase [:ok, :no_content, :found, :not_found].each do |status| [:get, :post, :put, :delete].each do |method| - unless method == :get and status == :ok + unless method == :get && status == :ok define_method "test_shouldnt_cache_#{method}_with_#{status}_status" do send(method, status) assert_response status -- cgit v1.2.3 From 06d772c0cea49d91eaa273469333430b317583bd Mon Sep 17 00:00:00 2001 From: Neeraj Singh Date: Fri, 10 Jun 2011 02:48:44 -0400 Subject: add missing ensure --- actionpack/test/controller/content_type_test.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/actionpack/test/controller/content_type_test.rb b/actionpack/test/controller/content_type_test.rb index b12c798302..d51882066d 100644 --- a/actionpack/test/controller/content_type_test.rb +++ b/actionpack/test/controller/content_type_test.rb @@ -74,6 +74,7 @@ class ContentTypeTest < ActionController::TestCase get :render_defaults assert_equal "utf-16", @response.charset assert_equal Mime::HTML, @response.content_type + ensure OldContentTypeController.default_charset = "utf-8" end -- cgit v1.2.3