From 278186534c0ccf285a20497461f40d2e54aa20a0 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Tue, 3 Feb 2009 18:25:37 -0800 Subject: Bump mocha requirement for Ruby 1.9 compat. Remove uses_mocha. --- actionpack/test/controller/caching_test.rb | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'actionpack/test/controller/caching_test.rb') diff --git a/actionpack/test/controller/caching_test.rb b/actionpack/test/controller/caching_test.rb index 7f8e47ba58..9af1ccc740 100644 --- a/actionpack/test/controller/caching_test.rb +++ b/actionpack/test/controller/caching_test.rb @@ -108,13 +108,11 @@ class PageCachingTest < ActionController::TestCase 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 - @request.stubs(:path).returns("/index.html") - get :ok - assert_response :ok - assert File.exist?("#{FILE_STORE_PATH}/index.html") - end + def test_should_cache_ok_at_custom_path + @request.stubs(:path).returns("/index.html") + get :ok + assert_response :ok + assert File.exist?("#{FILE_STORE_PATH}/index.html") end [:ok, :no_content, :found, :not_found].each do |status| @@ -291,13 +289,11 @@ class ActionCacheTest < ActionController::TestCase ActionController::Base.use_accept_header = old_use_accept_header end - uses_mocha 'test action cache' do - def test_action_cache_with_store_options - MockTime.expects(:now).returns(12345).once - @controller.expects(:read_fragment).with('hostname.com/action_caching_test', :expires_in => 1.hour).once - @controller.expects(:write_fragment).with('hostname.com/action_caching_test', '12345.0', :expires_in => 1.hour).once - get :index - end + def test_action_cache_with_store_options + MockTime.expects(:now).returns(12345).once + @controller.expects(:read_fragment).with('hostname.com/action_caching_test', :expires_in => 1.hour).once + @controller.expects(:write_fragment).with('hostname.com/action_caching_test', '12345.0', :expires_in => 1.hour).once + get :index end def test_action_cache_with_custom_cache_path -- cgit v1.2.3 From fa45540cdb30cee44983c9121e3ebfc317d21668 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Wed, 11 Mar 2009 00:02:08 +0100 Subject: Ensure correct content type is declared after cache hits on actions with string cache keys [#1585 state:resolved] Signed-off-by: Pratik Naik --- actionpack/test/controller/caching_test.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'actionpack/test/controller/caching_test.rb') diff --git a/actionpack/test/controller/caching_test.rb b/actionpack/test/controller/caching_test.rb index 9af1ccc740..86dafd9221 100644 --- a/actionpack/test/controller/caching_test.rb +++ b/actionpack/test/controller/caching_test.rb @@ -428,6 +428,20 @@ class ActionCacheTest < ActionController::TestCase assert_equal 'application/xml', @response.content_type end + def test_correct_content_type_is_returned_for_cache_hit_on_action_with_string_key + # run it twice to cache it the first time + get :show, :format => 'xml' + get :show, :format => 'xml' + assert_equal 'application/xml', @response.content_type + end + + def test_correct_content_type_is_returned_for_cache_hit_on_action_with_string_key_from_proc + # run it twice to cache it the first time + get :edit, :id => 1, :format => 'xml' + get :edit, :id => 1, :format => 'xml' + assert_equal 'application/xml', @response.content_type + end + def test_empty_path_is_normalized @mock_controller.mock_url_for = 'http://example.org/' @mock_controller.mock_path = '/' -- cgit v1.2.3