diff options
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/abstract_unit.rb | 1 | ||||
-rw-r--r-- | actionpack/test/controller/request_test.rb | 1 | ||||
-rw-r--r-- | actionpack/test/template/compiled_templates_test.rb | 9 | ||||
-rw-r--r-- | actionpack/test/template/render_test.rb | 7 |
4 files changed, 10 insertions, 8 deletions
diff --git a/actionpack/test/abstract_unit.rb b/actionpack/test/abstract_unit.rb index 2ba056e60f..30e2d863d0 100644 --- a/actionpack/test/abstract_unit.rb +++ b/actionpack/test/abstract_unit.rb @@ -34,7 +34,6 @@ ActionController::Base.session_store = nil FIXTURE_LOAD_PATH = File.join(File.dirname(__FILE__), 'fixtures') ActionController::Base.view_paths = FIXTURE_LOAD_PATH -ActionController::Base.view_paths.load def uses_mocha(test_name) yield diff --git a/actionpack/test/controller/request_test.rb b/actionpack/test/controller/request_test.rb index 349cea268f..c93d3152b8 100644 --- a/actionpack/test/controller/request_test.rb +++ b/actionpack/test/controller/request_test.rb @@ -441,6 +441,7 @@ class UrlEncodedRequestParameterParsingTest < ActiveSupport::TestCase def test_deep_query_string_with_array_of_hash assert_equal({'x' => {'y' => [{'z' => '10'}]}}, ActionController::RequestParser.parse_query_parameters('x[y][][z]=10')) assert_equal({'x' => {'y' => [{'z' => '10', 'w' => '10'}]}}, ActionController::RequestParser.parse_query_parameters('x[y][][z]=10&x[y][][w]=10')) + assert_equal({'x' => {'y' => [{'z' => '10', 'v' => {'w' => '10'}}]}}, ActionController::RequestParser.parse_query_parameters('x[y][][z]=10&x[y][][v][w]=10')) end def test_deep_query_string_with_array_of_hashes_with_one_pair diff --git a/actionpack/test/template/compiled_templates_test.rb b/actionpack/test/template/compiled_templates_test.rb index a68b09bb45..caea1bd643 100644 --- a/actionpack/test/template/compiled_templates_test.rb +++ b/actionpack/test/template/compiled_templates_test.rb @@ -31,7 +31,7 @@ uses_mocha 'TestTemplateRecompilation' do end def test_compiled_template_will_always_be_recompiled_when_template_is_not_cached - ActionView::Template.any_instance.expects(:loaded?).times(3).returns(false) + ActionView::Template.any_instance.expects(:recompile?).times(3).returns(true) assert_equal 0, @compiled_templates.instance_methods.size assert_equal "Hello world!", render(:file => "#{FIXTURE_LOAD_PATH}/test/hello_world.erb") ActionView::Template.any_instance.expects(:compile!).times(3) @@ -62,13 +62,14 @@ uses_mocha 'TestTemplateRecompilation' do def render_with_cache(*args) view_paths = ActionController::Base.view_paths - assert view_paths.first.loaded? + assert_equal ActionView::Template::EagerPath, view_paths.first.class ActionView::Base.new(view_paths, {}).render(*args) end def render_without_cache(*args) - view_paths = ActionView::Base.process_view_paths(FIXTURE_LOAD_PATH) - assert !view_paths.first.loaded? + path = ActionView::Template::Path.new(FIXTURE_LOAD_PATH) + view_paths = ActionView::Base.process_view_paths(path) + assert_equal ActionView::Template::Path, view_paths.first.class ActionView::Base.new(view_paths, {}).render(*args) end diff --git a/actionpack/test/template/render_test.rb b/actionpack/test/template/render_test.rb index 0387a11de2..4bd897efeb 100644 --- a/actionpack/test/template/render_test.rb +++ b/actionpack/test/template/render_test.rb @@ -197,7 +197,7 @@ class CachedViewRenderTest < Test::Unit::TestCase # Ensure view path cache is primed def setup view_paths = ActionController::Base.view_paths - assert view_paths.first.loaded? + assert_equal ActionView::Template::EagerPath, view_paths.first.class setup_view(view_paths) end end @@ -208,8 +208,9 @@ class LazyViewRenderTest < Test::Unit::TestCase # Test the same thing as above, but make sure the view path # is not eager loaded def setup - view_paths = ActionView::Base.process_view_paths(FIXTURE_LOAD_PATH) - assert !view_paths.first.loaded? + path = ActionView::Template::Path.new(FIXTURE_LOAD_PATH) + view_paths = ActionView::Base.process_view_paths(path) + assert_equal ActionView::Template::Path, view_paths.first.class setup_view(view_paths) end end |