actionpack 1.13.6 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of actionpack might be problematic. Click here for more details.
- data/CHANGELOG +1400 -20
- data/MIT-LICENSE +1 -1
- data/README +5 -5
- data/RUNNING_UNIT_TESTS +4 -5
- data/Rakefile +5 -6
- data/install.rb +2 -2
- data/lib/action_controller.rb +11 -15
- data/lib/action_controller/assertions.rb +12 -25
- data/lib/action_controller/assertions/dom_assertions.rb +18 -4
- data/lib/action_controller/assertions/model_assertions.rb +8 -1
- data/lib/action_controller/assertions/response_assertions.rb +35 -12
- data/lib/action_controller/assertions/routing_assertions.rb +56 -12
- data/lib/action_controller/assertions/selector_assertions.rb +105 -38
- data/lib/action_controller/assertions/tag_assertions.rb +28 -15
- data/lib/action_controller/base.rb +318 -250
- data/lib/action_controller/benchmarking.rb +33 -29
- data/lib/action_controller/caching.rb +130 -64
- data/lib/action_controller/cgi_ext.rb +16 -0
- data/lib/action_controller/cgi_ext/{cookie_performance_fix.rb → cookie.rb} +25 -40
- data/lib/action_controller/cgi_ext/query_extension.rb +22 -0
- data/lib/action_controller/cgi_ext/session.rb +73 -0
- data/lib/action_controller/cgi_ext/stdinput.rb +23 -0
- data/lib/action_controller/cgi_process.rb +34 -57
- data/lib/action_controller/components.rb +19 -36
- data/lib/action_controller/cookies.rb +10 -9
- data/lib/action_controller/dispatcher.rb +195 -0
- data/lib/action_controller/filters.rb +35 -34
- data/lib/action_controller/flash.rb +30 -35
- data/lib/action_controller/helpers.rb +121 -47
- data/lib/action_controller/http_authentication.rb +126 -0
- data/lib/action_controller/integration.rb +105 -101
- data/lib/action_controller/layout.rb +59 -47
- data/lib/action_controller/mime_responds.rb +57 -68
- data/lib/action_controller/mime_type.rb +43 -80
- data/lib/action_controller/mime_types.rb +20 -0
- data/lib/action_controller/polymorphic_routes.rb +88 -0
- data/lib/action_controller/record_identifier.rb +91 -0
- data/lib/action_controller/request.rb +553 -88
- data/lib/action_controller/request_forgery_protection.rb +126 -0
- data/lib/action_controller/request_profiler.rb +138 -0
- data/lib/action_controller/rescue.rb +185 -69
- data/lib/action_controller/resources.rb +211 -172
- data/lib/action_controller/response.rb +49 -8
- data/lib/action_controller/routing.rb +359 -236
- data/lib/action_controller/routing_optimisation.rb +119 -0
- data/lib/action_controller/session/active_record_store.rb +3 -2
- data/lib/action_controller/session/cookie_store.rb +161 -0
- data/lib/action_controller/session/mem_cache_store.rb +9 -16
- data/lib/action_controller/session_management.rb +17 -8
- data/lib/action_controller/streaming.rb +6 -3
- data/lib/action_controller/templates/rescues/_request_and_response.erb +24 -0
- data/lib/action_controller/templates/rescues/{_trace.rhtml → _trace.erb} +0 -0
- data/lib/action_controller/templates/rescues/{diagnostics.rhtml → diagnostics.erb} +2 -2
- data/lib/action_controller/templates/rescues/{layout.rhtml → layout.erb} +0 -0
- data/lib/action_controller/templates/rescues/{missing_template.rhtml → missing_template.erb} +0 -0
- data/lib/action_controller/templates/rescues/{routing_error.rhtml → routing_error.erb} +0 -0
- data/lib/action_controller/templates/rescues/{template_error.rhtml → template_error.erb} +2 -2
- data/lib/action_controller/templates/rescues/{unknown_action.rhtml → unknown_action.erb} +0 -0
- data/lib/action_controller/test_case.rb +53 -0
- data/lib/action_controller/test_process.rb +59 -46
- data/lib/action_controller/url_rewriter.rb +48 -24
- data/lib/action_controller/vendor/html-scanner/html/document.rb +7 -4
- data/lib/action_controller/vendor/html-scanner/html/sanitizer.rb +173 -0
- data/lib/action_controller/vendor/html-scanner/html/selector.rb +11 -6
- data/lib/action_controller/verification.rb +27 -21
- data/lib/action_pack.rb +1 -1
- data/lib/action_pack/version.rb +4 -4
- data/lib/action_view.rb +2 -3
- data/lib/action_view/base.rb +218 -63
- data/lib/action_view/compiled_templates.rb +1 -2
- data/lib/action_view/helpers/active_record_helper.rb +35 -17
- data/lib/action_view/helpers/asset_tag_helper.rb +395 -87
- data/lib/action_view/helpers/atom_feed_helper.rb +111 -0
- data/lib/action_view/helpers/benchmark_helper.rb +12 -5
- data/lib/action_view/helpers/cache_helper.rb +29 -0
- data/lib/action_view/helpers/capture_helper.rb +97 -63
- data/lib/action_view/helpers/date_helper.rb +295 -35
- data/lib/action_view/helpers/debug_helper.rb +6 -2
- data/lib/action_view/helpers/form_helper.rb +354 -111
- data/lib/action_view/helpers/form_options_helper.rb +171 -109
- data/lib/action_view/helpers/form_tag_helper.rb +332 -76
- data/lib/action_view/helpers/javascript_helper.rb +35 -11
- data/lib/action_view/helpers/javascripts/controls.js +484 -354
- data/lib/action_view/helpers/javascripts/dragdrop.js +88 -58
- data/lib/action_view/helpers/javascripts/effects.js +396 -364
- data/lib/action_view/helpers/javascripts/prototype.js +2817 -1107
- data/lib/action_view/helpers/number_helper.rb +84 -60
- data/lib/action_view/helpers/prototype_helper.rb +419 -43
- data/lib/action_view/helpers/record_identification_helper.rb +20 -0
- data/lib/action_view/helpers/record_tag_helper.rb +59 -0
- data/lib/action_view/helpers/sanitize_helper.rb +223 -0
- data/lib/action_view/helpers/scriptaculous_helper.rb +63 -4
- data/lib/action_view/helpers/tag_helper.rb +69 -39
- data/lib/action_view/helpers/text_helper.rb +221 -148
- data/lib/action_view/helpers/url_helper.rb +283 -165
- data/lib/action_view/partials.rb +134 -62
- data/lib/action_view/template_error.rb +4 -12
- data/lib/actionpack.rb +1 -0
- data/test/abstract_unit.rb +21 -1
- data/test/action_view_test.rb +26 -0
- data/test/active_record_unit.rb +12 -20
- data/test/activerecord/active_record_store_test.rb +2 -2
- data/test/activerecord/render_partial_with_record_identification_test.rb +74 -0
- data/test/controller/action_pack_assertions_test.rb +21 -152
- data/test/controller/addresses_render_test.rb +2 -7
- data/test/controller/assert_select_test.rb +120 -14
- data/test/controller/base_test.rb +11 -13
- data/test/controller/caching_test.rb +125 -5
- data/test/controller/capture_test.rb +23 -16
- data/test/controller/cgi_test.rb +66 -391
- data/test/controller/components_test.rb +31 -42
- data/test/controller/content_type_test.rb +1 -1
- data/test/controller/cookie_test.rb +42 -14
- data/test/controller/deprecation/deprecated_base_methods_test.rb +1 -42
- data/test/controller/dispatcher_test.rb +123 -0
- data/test/controller/fake_models.rb +5 -0
- data/test/controller/filters_test.rb +44 -7
- data/test/controller/flash_test.rb +46 -2
- data/test/controller/fragment_store_setting_test.rb +10 -8
- data/test/controller/helper_test.rb +19 -2
- data/test/controller/html-scanner/document_test.rb +124 -0
- data/test/controller/html-scanner/node_test.rb +69 -0
- data/test/controller/html-scanner/sanitizer_test.rb +250 -0
- data/test/controller/html-scanner/tag_node_test.rb +239 -0
- data/test/controller/html-scanner/text_node_test.rb +51 -0
- data/test/controller/html-scanner/tokenizer_test.rb +125 -0
- data/test/controller/http_authentication_test.rb +54 -0
- data/test/controller/integration_test.rb +12 -26
- data/test/controller/layout_test.rb +64 -12
- data/test/controller/mime_responds_test.rb +193 -38
- data/test/controller/mime_type_test.rb +30 -8
- data/test/controller/new_render_test.rb +104 -22
- data/test/controller/polymorphic_routes_test.rb +98 -0
- data/test/controller/record_identifier_test.rb +103 -0
- data/test/controller/redirect_test.rb +120 -18
- data/test/controller/render_test.rb +195 -45
- data/test/controller/request_forgery_protection_test.rb +217 -0
- data/test/controller/request_test.rb +545 -27
- data/test/controller/rescue_test.rb +501 -0
- data/test/controller/resources_test.rb +258 -132
- data/test/controller/routing_test.rb +502 -106
- data/test/controller/selector_test.rb +5 -5
- data/test/controller/send_file_test.rb +17 -7
- data/test/controller/session/cookie_store_test.rb +246 -0
- data/test/controller/session/mem_cache_store_test.rb +182 -0
- data/test/controller/session_fixation_test.rb +8 -11
- data/test/controller/session_management_test.rb +7 -7
- data/test/controller/test_test.rb +150 -38
- data/test/controller/url_rewriter_test.rb +87 -12
- data/test/controller/verification_test.rb +11 -0
- data/test/controller/view_paths_test.rb +137 -0
- data/test/controller/webservice_test.rb +11 -75
- data/test/fixtures/addresses/{list.rhtml → list.erb} +0 -0
- data/test/fixtures/db_definitions/sqlite.sql +2 -1
- data/test/fixtures/developer.rb +2 -0
- data/test/fixtures/fun/games/{hello_world.rhtml → hello_world.erb} +0 -0
- data/test/fixtures/helpers/fun/pdf_helper.rb +1 -1
- data/test/fixtures/layout_tests/alt/hello.rhtml +1 -0
- data/test/fixtures/layout_tests/layouts/multiple_extensions.html.erb +1 -0
- data/test/fixtures/layouts/{builder.rxml → builder.builder} +0 -0
- data/test/fixtures/layouts/{standard.rhtml → standard.erb} +0 -0
- data/test/fixtures/layouts/{talk_from_action.rhtml → talk_from_action.erb} +0 -0
- data/test/fixtures/layouts/{yield.rhtml → yield.erb} +0 -0
- data/test/fixtures/multipart/binary_file +0 -0
- data/test/fixtures/multipart/bracketed_param +5 -0
- data/test/fixtures/override/test/hello_world.erb +1 -0
- data/test/fixtures/override2/layouts/test/sub.erb +1 -0
- data/test/fixtures/post_test/layouts/post.html.erb +1 -0
- data/test/fixtures/post_test/layouts/super_post.iphone.erb +1 -0
- data/test/fixtures/post_test/post/index.html.erb +1 -0
- data/test/fixtures/post_test/post/index.iphone.erb +1 -0
- data/test/fixtures/post_test/super_post/index.html.erb +1 -0
- data/test/fixtures/post_test/super_post/index.iphone.erb +1 -0
- data/test/fixtures/public/404.html +1 -0
- data/test/fixtures/public/500.html +1 -0
- data/test/fixtures/public/javascripts/application.js +0 -1
- data/test/fixtures/public/javascripts/bank.js +1 -0
- data/test/fixtures/public/javascripts/robber.js +1 -0
- data/test/fixtures/public/stylesheets/bank.css +1 -0
- data/test/fixtures/public/stylesheets/robber.css +1 -0
- data/test/fixtures/replies.yml +2 -0
- data/test/fixtures/reply.rb +2 -1
- data/test/fixtures/respond_to/{all_types_with_layout.rhtml → all_types_with_layout.html.erb} +0 -0
- data/test/fixtures/respond_to/{all_types_with_layout.rjs → all_types_with_layout.js.rjs} +0 -0
- data/test/fixtures/respond_to/custom_constant_handling_without_block.mobile.erb +1 -0
- data/test/fixtures/respond_to/iphone_with_html_response_type.html.erb +1 -0
- data/test/fixtures/respond_to/iphone_with_html_response_type.iphone.erb +1 -0
- data/test/fixtures/respond_to/layouts/missing.html.erb +1 -0
- data/test/fixtures/respond_to/layouts/standard.html.erb +1 -0
- data/test/fixtures/respond_to/layouts/standard.iphone.erb +1 -0
- data/test/fixtures/respond_to/{using_defaults.rhtml → using_defaults.html.erb} +0 -0
- data/test/fixtures/respond_to/{using_defaults.rjs → using_defaults.js.rjs} +0 -0
- data/test/fixtures/respond_to/{using_defaults.rxml → using_defaults.xml.builder} +0 -0
- data/test/fixtures/respond_to/{using_defaults_with_type_list.rhtml → using_defaults_with_type_list.html.erb} +0 -0
- data/test/fixtures/respond_to/{using_defaults_with_type_list.rjs → using_defaults_with_type_list.js.rjs} +0 -0
- data/test/fixtures/respond_to/{using_defaults_with_type_list.rxml → using_defaults_with_type_list.xml.builder} +0 -0
- data/test/fixtures/scope/test/{modgreet.rhtml → modgreet.erb} +0 -0
- data/test/fixtures/test/{_customer.rhtml → _customer.erb} +0 -0
- data/test/fixtures/test/{_customer_greeting.rhtml → _customer_greeting.erb} +0 -0
- data/test/fixtures/test/_hash_greeting.erb +1 -0
- data/test/fixtures/test/_hash_object.erb +2 -0
- data/test/fixtures/test/{_hello.rxml → _hello.builder} +0 -0
- data/test/fixtures/test/_layout_for_partial.html.erb +3 -0
- data/test/fixtures/test/_partial.erb +1 -0
- data/test/fixtures/test/_partial.html.erb +1 -0
- data/test/fixtures/test/_partial.js.erb +1 -0
- data/test/fixtures/test/_partial_for_use_in_layout.html.erb +1 -0
- data/test/fixtures/test/{_partial_only.rhtml → _partial_only.erb} +0 -0
- data/test/fixtures/test/{_person.rhtml → _person.erb} +0 -0
- data/test/fixtures/test/{action_talk_to_layout.rhtml → action_talk_to_layout.erb} +0 -0
- data/test/fixtures/test/{block_content_for.rhtml → block_content_for.erb} +0 -0
- data/test/fixtures/test/calling_partial_with_layout.html.erb +1 -0
- data/test/fixtures/test/{capturing.rhtml → capturing.erb} +0 -0
- data/test/fixtures/test/{content_for.rhtml → content_for.erb} +0 -0
- data/test/fixtures/test/content_for_concatenated.erb +3 -0
- data/test/fixtures/test/content_for_with_parameter.erb +2 -0
- data/test/fixtures/test/dot.directory/{render_file_with_ivar.rhtml → render_file_with_ivar.erb} +0 -0
- data/test/fixtures/test/{erb_content_for.rhtml → erb_content_for.erb} +0 -0
- data/test/fixtures/test/formatted_html_erb.html.erb +1 -0
- data/test/fixtures/test/formatted_xml_erb.builder +1 -0
- data/test/fixtures/test/formatted_xml_erb.html.erb +1 -0
- data/test/fixtures/test/formatted_xml_erb.xml.erb +1 -0
- data/test/fixtures/test/{greeting.rhtml → greeting.erb} +0 -0
- data/test/fixtures/test/{hello.rxml → hello.builder} +0 -0
- data/test/fixtures/test/{hello_world.rxml → hello_world.builder} +0 -0
- data/test/fixtures/test/{hello_world.rhtml → hello_world.erb} +0 -0
- data/test/fixtures/test/{hello_world_container.rxml → hello_world_container.builder} +0 -0
- data/test/fixtures/test/{hello_world_with_layout_false.rhtml → hello_world_with_layout_false.erb} +0 -0
- data/test/fixtures/test/{hello_xml_world.rxml → hello_xml_world.builder} +0 -0
- data/test/fixtures/test/list.erb +1 -0
- data/test/fixtures/test/{non_erb_block_content_for.rxml → non_erb_block_content_for.builder} +0 -0
- data/test/fixtures/test/{potential_conflicts.rhtml → potential_conflicts.erb} +0 -0
- data/test/fixtures/test/{render_file_with_ivar.rhtml → render_file_with_ivar.erb} +0 -0
- data/test/fixtures/test/{render_file_with_locals.rhtml → render_file_with_locals.erb} +0 -0
- data/test/fixtures/test/{render_to_string_test.rhtml → render_to_string_test.erb} +0 -0
- data/test/fixtures/test/{update_element_with_capture.rhtml → update_element_with_capture.erb} +0 -0
- data/test/fixtures/test/using_layout_around_block.html.erb +1 -0
- data/test/fixtures/topic.rb +1 -1
- data/test/template/active_record_helper_test.rb +67 -20
- data/test/template/asset_tag_helper_test.rb +222 -54
- data/test/template/atom_feed_helper_test.rb +101 -0
- data/test/template/benchmark_helper_test.rb +2 -2
- data/test/template/compiled_templates_test.rb +76 -32
- data/test/template/date_helper_test.rb +125 -9
- data/test/template/form_helper_test.rb +326 -33
- data/test/template/form_options_helper_test.rb +822 -15
- data/test/template/form_tag_helper_test.rb +96 -30
- data/test/template/javascript_helper_test.rb +61 -13
- data/test/template/number_helper_test.rb +12 -11
- data/test/template/prototype_helper_test.rb +185 -24
- data/test/template/sanitize_helper_test.rb +49 -0
- data/test/template/scriptaculous_helper_test.rb +9 -3
- data/test/template/tag_helper_test.rb +13 -2
- data/test/template/text_helper_test.rb +38 -52
- data/test/template/url_helper_test.rb +216 -46
- metadata +144 -116
- data/examples/.htaccess +0 -24
- data/examples/address_book/index.rhtml +0 -33
- data/examples/address_book/layout.rhtml +0 -8
- data/examples/address_book_controller.cgi +0 -9
- data/examples/address_book_controller.fcgi +0 -6
- data/examples/address_book_controller.rb +0 -52
- data/examples/address_book_controller.rbx +0 -4
- data/examples/benchmark.rb +0 -52
- data/examples/benchmark_with_ar.fcgi +0 -89
- data/examples/blog_controller.cgi +0 -53
- data/examples/debate/index.rhtml +0 -14
- data/examples/debate/new_topic.rhtml +0 -22
- data/examples/debate/topic.rhtml +0 -32
- data/examples/debate_controller.cgi +0 -57
- data/lib/action_controller/assertions/deprecated_assertions.rb +0 -228
- data/lib/action_controller/cgi_ext/cgi_ext.rb +0 -36
- data/lib/action_controller/cgi_ext/cgi_methods.rb +0 -211
- data/lib/action_controller/cgi_ext/pstore_performance_fix.rb +0 -30
- data/lib/action_controller/cgi_ext/raw_post_data_fix.rb +0 -95
- data/lib/action_controller/cgi_ext/session_performance_fix.rb +0 -30
- data/lib/action_controller/deprecated_dependencies.rb +0 -65
- data/lib/action_controller/deprecated_redirects.rb +0 -17
- data/lib/action_controller/deprecated_request_methods.rb +0 -34
- data/lib/action_controller/macros/auto_complete.rb +0 -53
- data/lib/action_controller/macros/in_place_editing.rb +0 -33
- data/lib/action_controller/pagination.rb +0 -408
- data/lib/action_controller/scaffolding.rb +0 -189
- data/lib/action_controller/templates/rescues/_request_and_response.rhtml +0 -44
- data/lib/action_controller/templates/scaffolds/edit.rhtml +0 -7
- data/lib/action_controller/templates/scaffolds/layout.rhtml +0 -69
- data/lib/action_controller/templates/scaffolds/list.rhtml +0 -27
- data/lib/action_controller/templates/scaffolds/new.rhtml +0 -6
- data/lib/action_controller/templates/scaffolds/show.rhtml +0 -9
- data/lib/action_controller/vendor/xml_node.rb +0 -97
- data/lib/action_view/helpers/deprecated_helper.rb +0 -37
- data/lib/action_view/helpers/java_script_macros_helper.rb +0 -233
- data/lib/action_view/helpers/pagination_helper.rb +0 -86
- data/test/activerecord/active_record_assertions_test.rb +0 -92
- data/test/activerecord/pagination_test.rb +0 -165
- data/test/controller/deprecated_instance_variables_test.rb +0 -48
- data/test/controller/raw_post_test.rb +0 -68
- data/test/fixtures/deprecated_instance_variables/_cookies_ivar.rhtml +0 -1
- data/test/fixtures/deprecated_instance_variables/_cookies_method.rhtml +0 -1
- data/test/fixtures/deprecated_instance_variables/_flash_ivar.rhtml +0 -1
- data/test/fixtures/deprecated_instance_variables/_flash_method.rhtml +0 -1
- data/test/fixtures/deprecated_instance_variables/_headers_ivar.rhtml +0 -1
- data/test/fixtures/deprecated_instance_variables/_headers_method.rhtml +0 -1
- data/test/fixtures/deprecated_instance_variables/_params_ivar.rhtml +0 -1
- data/test/fixtures/deprecated_instance_variables/_params_method.rhtml +0 -1
- data/test/fixtures/deprecated_instance_variables/_request_ivar.rhtml +0 -1
- data/test/fixtures/deprecated_instance_variables/_request_method.rhtml +0 -1
- data/test/fixtures/deprecated_instance_variables/_response_ivar.rhtml +0 -1
- data/test/fixtures/deprecated_instance_variables/_response_method.rhtml +0 -1
- data/test/fixtures/deprecated_instance_variables/_session_ivar.rhtml +0 -1
- data/test/fixtures/deprecated_instance_variables/_session_method.rhtml +0 -1
- data/test/fixtures/respond_to/layouts/standard.rhtml +0 -1
- data/test/fixtures/test/_hash_object.rhtml +0 -1
- data/test/fixtures/test/list.rhtml +0 -1
- data/test/template/deprecated_helper_test.rb +0 -36
- data/test/template/deprecated_instance_variables_test.rb +0 -43
- data/test/template/java_script_macros_helper_test.rb +0 -109
@@ -1,5 +1,6 @@
|
|
1
1
|
require File.dirname(__FILE__) + '/../abstract_unit'
|
2
2
|
|
3
|
+
|
3
4
|
class SessionFixationTest < Test::Unit::TestCase
|
4
5
|
class MockCGI < CGI #:nodoc:
|
5
6
|
attr_accessor :stdoutput, :env_table
|
@@ -7,12 +8,12 @@ class SessionFixationTest < Test::Unit::TestCase
|
|
7
8
|
def initialize(env, data = '')
|
8
9
|
self.env_table = env
|
9
10
|
self.stdoutput = StringIO.new
|
10
|
-
super(StringIO.new(data))
|
11
|
+
super(nil, StringIO.new(data))
|
11
12
|
end
|
12
13
|
end
|
13
14
|
|
14
15
|
class TestController < ActionController::Base
|
15
|
-
session :session_key => '_myapp_session_id', :secret =>
|
16
|
+
session :session_key => '_myapp_session_id', :secret => CGI::Session.generate_unique_id, :except => :default_session_key
|
16
17
|
session :cookie_only => false, :only => :allow_session_fixation
|
17
18
|
|
18
19
|
def default_session_key
|
@@ -38,7 +39,7 @@ class SessionFixationTest < Test::Unit::TestCase
|
|
38
39
|
cgi = mock_cgi_for_request_to(:custom_session_key, :id => 1)
|
39
40
|
|
40
41
|
assert_nothing_raised do
|
41
|
-
@controller.send(:process,
|
42
|
+
@controller.send(:process, ActionController::CgiRequest.new(cgi, {}), ActionController::CgiResponse.new(cgi))
|
42
43
|
end
|
43
44
|
assert_equal 'custom_session_key: 1', @controller.response.body
|
44
45
|
assert_not_nil @controller.session
|
@@ -48,7 +49,7 @@ class SessionFixationTest < Test::Unit::TestCase
|
|
48
49
|
cgi = mock_cgi_for_request_to(:custom_session_key, :_myapp_session_id => 42)
|
49
50
|
|
50
51
|
assert_raises ActionController::CgiRequest::SessionFixationAttempt do
|
51
|
-
@controller.send(:process,
|
52
|
+
@controller.send(:process, ActionController::CgiRequest.new(cgi, {}), ActionController::CgiResponse.new(cgi))
|
52
53
|
end
|
53
54
|
assert_nil @controller.session
|
54
55
|
end
|
@@ -57,9 +58,9 @@ class SessionFixationTest < Test::Unit::TestCase
|
|
57
58
|
cgi = mock_cgi_for_request_to(:allow_session_fixation, :_myapp_session_id => 42)
|
58
59
|
|
59
60
|
assert_nothing_raised do
|
60
|
-
@controller.send(:process,
|
61
|
+
@controller.send(:process, ActionController::CgiRequest.new(cgi, {}), ActionController::CgiResponse.new(cgi))
|
61
62
|
end
|
62
|
-
assert
|
63
|
+
assert ! @controller.response.body.blank?
|
63
64
|
assert_not_nil @controller.session
|
64
65
|
end
|
65
66
|
|
@@ -68,7 +69,7 @@ class SessionFixationTest < Test::Unit::TestCase
|
|
68
69
|
cgi = mock_cgi_for_request_to(:default_session_key, :_session_id => 42)
|
69
70
|
|
70
71
|
assert_raises ActionController::CgiRequest::SessionFixationAttempt do
|
71
|
-
@controller.send(:process,
|
72
|
+
@controller.send(:process, ActionController::CgiRequest.new(cgi, {}), ActionController::CgiResponse.new(cgi))
|
72
73
|
end
|
73
74
|
assert @controller.response.body.blank?
|
74
75
|
assert_nil @controller.session
|
@@ -85,8 +86,4 @@ private
|
|
85
86
|
"HTTP_HOST" => "testdomain.com" }, '')
|
86
87
|
end
|
87
88
|
|
88
|
-
def mock_request(cgi)
|
89
|
-
ActionController::CgiRequest.new(cgi, {})
|
90
|
-
end
|
91
|
-
|
92
89
|
end
|
@@ -5,11 +5,11 @@ class SessionManagementTest < Test::Unit::TestCase
|
|
5
5
|
session :off
|
6
6
|
|
7
7
|
def show
|
8
|
-
|
8
|
+
render :text => "done"
|
9
9
|
end
|
10
10
|
|
11
11
|
def tell
|
12
|
-
|
12
|
+
render :text => "done"
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
@@ -20,15 +20,15 @@ class SessionManagementTest < Test::Unit::TestCase
|
|
20
20
|
:if => Proc.new { |r| r.parameters[:ws] }
|
21
21
|
|
22
22
|
def show
|
23
|
-
|
23
|
+
render :text => "done"
|
24
24
|
end
|
25
25
|
|
26
26
|
def tell
|
27
|
-
|
27
|
+
render :text => "done"
|
28
28
|
end
|
29
29
|
|
30
30
|
def conditional
|
31
|
-
|
31
|
+
render :text => ">>>#{params[:ws]}<<<"
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
@@ -36,11 +36,11 @@ class SessionManagementTest < Test::Unit::TestCase
|
|
36
36
|
session :disabled => false, :only => :something
|
37
37
|
|
38
38
|
def something
|
39
|
-
|
39
|
+
render :text => "done"
|
40
40
|
end
|
41
41
|
|
42
42
|
def another
|
43
|
-
|
43
|
+
render :text => "done"
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
@@ -1,5 +1,6 @@
|
|
1
|
-
require File.dirname(__FILE__)
|
2
|
-
require File.dirname(__FILE__)
|
1
|
+
require "#{File.dirname(__FILE__)}/../abstract_unit"
|
2
|
+
require "#{File.dirname(__FILE__)}/fake_controllers"
|
3
|
+
require "action_controller/test_case"
|
3
4
|
|
4
5
|
class TestTest < Test::Unit::TestCase
|
5
6
|
class TestController < ActionController::Base
|
@@ -13,6 +14,10 @@ class TestTest < Test::Unit::TestCase
|
|
13
14
|
render :text => request.raw_post
|
14
15
|
end
|
15
16
|
|
17
|
+
def render_body
|
18
|
+
render :text => request.body.read
|
19
|
+
end
|
20
|
+
|
16
21
|
def test_params
|
17
22
|
render :text => params.inspect
|
18
23
|
end
|
@@ -21,6 +26,10 @@ class TestTest < Test::Unit::TestCase
|
|
21
26
|
render :text => request.request_uri
|
22
27
|
end
|
23
28
|
|
29
|
+
def test_query_string
|
30
|
+
render :text => request.query_string
|
31
|
+
end
|
32
|
+
|
24
33
|
def test_html_output
|
25
34
|
render :text => <<HTML
|
26
35
|
<html>
|
@@ -41,6 +50,16 @@ class TestTest < Test::Unit::TestCase
|
|
41
50
|
</html>
|
42
51
|
HTML
|
43
52
|
end
|
53
|
+
|
54
|
+
def test_xml_output
|
55
|
+
response.content_type = "application/xml"
|
56
|
+
render :text => <<XML
|
57
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
58
|
+
<root>
|
59
|
+
<area>area is an empty tag in HTML, raising an error if not in xml mode</area>
|
60
|
+
</root>
|
61
|
+
XML
|
62
|
+
end
|
44
63
|
|
45
64
|
def test_only_one_param
|
46
65
|
render :text => (params[:left] && params[:right]) ? "EEP, Both here!" : "OK"
|
@@ -54,8 +73,8 @@ HTML
|
|
54
73
|
render :text => params[:file].size
|
55
74
|
end
|
56
75
|
|
57
|
-
def
|
58
|
-
|
76
|
+
def test_send_file
|
77
|
+
send_file(File.expand_path(__FILE__))
|
59
78
|
end
|
60
79
|
|
61
80
|
def redirect_to_same_controller
|
@@ -67,8 +86,7 @@ HTML
|
|
67
86
|
end
|
68
87
|
|
69
88
|
def create
|
70
|
-
|
71
|
-
head :created
|
89
|
+
head :created, :location => 'created resource'
|
72
90
|
end
|
73
91
|
|
74
92
|
private
|
@@ -95,10 +113,17 @@ HTML
|
|
95
113
|
|
96
114
|
def test_raw_post_handling
|
97
115
|
params = {:page => {:name => 'page name'}, 'some key' => 123}
|
98
|
-
|
116
|
+
post :render_raw_post, params.dup
|
99
117
|
|
100
|
-
|
101
|
-
|
118
|
+
assert_equal params.to_query, @response.body
|
119
|
+
end
|
120
|
+
|
121
|
+
def test_body_stream
|
122
|
+
params = { :page => { :name => 'page name' }, 'some key' => 123 }
|
123
|
+
|
124
|
+
post :render_body, params.dup
|
125
|
+
|
126
|
+
assert_equal params.to_query, @response.body
|
102
127
|
end
|
103
128
|
|
104
129
|
def test_process_without_flash
|
@@ -127,6 +152,17 @@ HTML
|
|
127
152
|
assert_equal "/explicit/uri", @response.body
|
128
153
|
end
|
129
154
|
|
155
|
+
def test_process_with_query_string
|
156
|
+
process :test_query_string, :q => 'test'
|
157
|
+
assert_equal "q=test", @response.body
|
158
|
+
end
|
159
|
+
|
160
|
+
def test_process_with_query_string_with_explicit_uri
|
161
|
+
@request.set_REQUEST_URI "/explicit/uri?q=test?extra=question"
|
162
|
+
process :test_query_string
|
163
|
+
assert_equal "q=test?extra=question", @response.body
|
164
|
+
end
|
165
|
+
|
130
166
|
def test_multiple_calls
|
131
167
|
process :test_only_one_param, :left => true
|
132
168
|
assert_equal "OK", @response.body
|
@@ -182,7 +218,7 @@ HTML
|
|
182
218
|
def test_assert_tag_descendant
|
183
219
|
process :test_html_output
|
184
220
|
|
185
|
-
# there is a tag with a
|
221
|
+
# there is a tag with a descendant 'li' tag
|
186
222
|
assert_tag :descendant => { :tag => "li" }
|
187
223
|
# there is no tag with a descendant 'html' tag
|
188
224
|
assert_no_tag :descendant => { :tag => "html" }
|
@@ -209,9 +245,9 @@ HTML
|
|
209
245
|
def test_assert_tag_before
|
210
246
|
process :test_html_output
|
211
247
|
|
212
|
-
# there is a tag
|
248
|
+
# there is a tag preceding a tag with id 'bar'
|
213
249
|
assert_tag :before => { :attributes => { :id => "bar" } }
|
214
|
-
# there is no tag
|
250
|
+
# there is no tag preceding a 'form' tag
|
215
251
|
assert_no_tag :before => { :tag => "form" }
|
216
252
|
end
|
217
253
|
|
@@ -295,6 +331,20 @@ HTML
|
|
295
331
|
:children => { :count => 1,
|
296
332
|
:only => { :tag => "img" } } } }
|
297
333
|
end
|
334
|
+
|
335
|
+
def test_should_not_impose_childless_html_tags_in_xml
|
336
|
+
process :test_xml_output
|
337
|
+
|
338
|
+
begin
|
339
|
+
$stderr = StringIO.new
|
340
|
+
assert_select 'area' #This will cause a warning if content is processed as HTML
|
341
|
+
$stderr.rewind && err = $stderr.read
|
342
|
+
ensure
|
343
|
+
$stderr = STDERR
|
344
|
+
end
|
345
|
+
|
346
|
+
assert err.empty?
|
347
|
+
end
|
298
348
|
|
299
349
|
def test_assert_tag_attribute_matching
|
300
350
|
@response.body = '<input type="text" name="my_name">'
|
@@ -430,26 +480,40 @@ HTML
|
|
430
480
|
assert_equal file.path, file.local_path
|
431
481
|
assert_equal File.read(path), file.read
|
432
482
|
end
|
483
|
+
|
484
|
+
def test_test_uploaded_file_with_binary
|
485
|
+
filename = 'mona_lisa.jpg'
|
486
|
+
path = "#{FILES_DIR}/#{filename}"
|
487
|
+
content_type = 'image/png'
|
488
|
+
|
489
|
+
binary_uploaded_file = ActionController::TestUploadedFile.new(path, content_type, :binary)
|
490
|
+
assert_equal File.open(path, 'rb').read, binary_uploaded_file.read
|
491
|
+
|
492
|
+
plain_uploaded_file = ActionController::TestUploadedFile.new(path, content_type)
|
493
|
+
assert_equal File.open(path, 'r').read, plain_uploaded_file.read
|
494
|
+
end
|
495
|
+
|
496
|
+
def test_fixture_file_upload_with_binary
|
497
|
+
filename = 'mona_lisa.jpg'
|
498
|
+
path = "#{FILES_DIR}/#{filename}"
|
499
|
+
content_type = 'image/jpg'
|
500
|
+
|
501
|
+
binary_file_upload = fixture_file_upload(path, content_type, :binary)
|
502
|
+
assert_equal File.open(path, 'rb').read, binary_file_upload.read
|
503
|
+
|
504
|
+
plain_file_upload = fixture_file_upload(path, content_type)
|
505
|
+
assert_equal File.open(path, 'r').read, plain_file_upload.read
|
506
|
+
end
|
433
507
|
|
434
508
|
def test_fixture_file_upload
|
435
509
|
post :test_file_upload, :file => fixture_file_upload(FILES_DIR + "/mona_lisa.jpg", "image/jpg")
|
436
|
-
assert_equal 159528, @response.body
|
510
|
+
assert_equal '159528', @response.body
|
437
511
|
end
|
438
512
|
|
439
513
|
def test_test_uploaded_file_exception_when_file_doesnt_exist
|
440
514
|
assert_raise(RuntimeError) { ActionController::TestUploadedFile.new('non_existent_file') }
|
441
515
|
end
|
442
516
|
|
443
|
-
def test_assert_redirected_to_symbol
|
444
|
-
with_foo_routing do |set|
|
445
|
-
assert_deprecated(/generate_url.*redirect_to/) do
|
446
|
-
get :redirect_to_symbol
|
447
|
-
end
|
448
|
-
assert_response :redirect
|
449
|
-
assert_redirected_to :generate_url
|
450
|
-
end
|
451
|
-
end
|
452
|
-
|
453
517
|
def test_assert_follow_redirect_to_same_controller
|
454
518
|
with_foo_routing do |set|
|
455
519
|
get :redirect_to_same_controller
|
@@ -482,22 +546,11 @@ HTML
|
|
482
546
|
end
|
483
547
|
end
|
484
548
|
|
485
|
-
def
|
486
|
-
get :
|
487
|
-
|
488
|
-
assert_equal @request.env['REQUEST_URI'], uri
|
489
|
-
|
490
|
-
get :test_uri
|
491
|
-
assert_not_equal uri, @request.request_uri
|
492
|
-
uri = @request.request_uri
|
493
|
-
assert_equal @request.env['REQUEST_URI'], uri
|
494
|
-
|
495
|
-
get :test_uri, :testing => true
|
496
|
-
assert_not_equal uri, @request.request_uri
|
497
|
-
uri = @request.request_uri
|
498
|
-
assert_equal @request.env['REQUEST_URI'], uri
|
549
|
+
def test_binary_content_works_with_send_file
|
550
|
+
get :test_send_file
|
551
|
+
assert_nothing_raised(NoMethodError) { @response.binary_content }
|
499
552
|
end
|
500
|
-
|
553
|
+
|
501
554
|
protected
|
502
555
|
def with_foo_routing
|
503
556
|
with_routing do |set|
|
@@ -509,3 +562,62 @@ HTML
|
|
509
562
|
end
|
510
563
|
end
|
511
564
|
end
|
565
|
+
|
566
|
+
|
567
|
+
class CleanBacktraceTest < Test::Unit::TestCase
|
568
|
+
def test_should_reraise_the_same_object
|
569
|
+
exception = Test::Unit::AssertionFailedError.new('message')
|
570
|
+
clean_backtrace { raise exception }
|
571
|
+
rescue => caught
|
572
|
+
assert_equal exception.object_id, caught.object_id
|
573
|
+
assert_equal exception.message, caught.message
|
574
|
+
end
|
575
|
+
|
576
|
+
def test_should_clean_assertion_lines_from_backtrace
|
577
|
+
path = File.expand_path("#{File.dirname(__FILE__)}/../../lib/action_controller")
|
578
|
+
exception = Test::Unit::AssertionFailedError.new('message')
|
579
|
+
exception.set_backtrace ["#{path}/abc", "#{path}/assertions/def"]
|
580
|
+
clean_backtrace { raise exception }
|
581
|
+
rescue => caught
|
582
|
+
assert_equal ["#{path}/abc"], caught.backtrace
|
583
|
+
end
|
584
|
+
|
585
|
+
def test_should_only_clean_assertion_failure_errors
|
586
|
+
clean_backtrace do
|
587
|
+
raise "can't touch this", [File.expand_path("#{File.dirname(__FILE__)}/../../lib/action_controller/assertions/abc")]
|
588
|
+
end
|
589
|
+
rescue => caught
|
590
|
+
assert !caught.backtrace.empty?
|
591
|
+
end
|
592
|
+
end
|
593
|
+
|
594
|
+
class InferringClassNameTest < Test::Unit::TestCase
|
595
|
+
def test_determine_controller_class
|
596
|
+
assert_equal ContentController, determine_class("ContentControllerTest")
|
597
|
+
end
|
598
|
+
|
599
|
+
def test_determine_controller_class_with_nonsense_name
|
600
|
+
assert_raises ActionController::NonInferrableControllerError do
|
601
|
+
determine_class("HelloGoodBye")
|
602
|
+
end
|
603
|
+
end
|
604
|
+
|
605
|
+
def test_determine_controller_class_with_sensible_name_where_no_controller_exists
|
606
|
+
assert_raises ActionController::NonInferrableControllerError do
|
607
|
+
determine_class("NoControllerWithThisNameTest")
|
608
|
+
end
|
609
|
+
end
|
610
|
+
|
611
|
+
private
|
612
|
+
def determine_class(name)
|
613
|
+
ActionController::TestCase.determine_default_controller_class(name)
|
614
|
+
end
|
615
|
+
end
|
616
|
+
|
617
|
+
class CrazyNameTest < ActionController::TestCase
|
618
|
+
tests ContentController
|
619
|
+
def test_controller_class_can_be_set_manually_not_just_inferred
|
620
|
+
assert_equal ContentController, self.class.controller_class
|
621
|
+
end
|
622
|
+
end
|
623
|
+
|
@@ -1,5 +1,7 @@
|
|
1
1
|
require File.dirname(__FILE__) + '/../abstract_unit'
|
2
2
|
|
3
|
+
ActionController::UrlRewriter
|
4
|
+
|
3
5
|
class UrlRewriterTests < Test::Unit::TestCase
|
4
6
|
def setup
|
5
7
|
@request = ActionController::TestRequest.new
|
@@ -7,6 +9,43 @@ class UrlRewriterTests < Test::Unit::TestCase
|
|
7
9
|
@rewriter = ActionController::UrlRewriter.new(@request, @params)
|
8
10
|
end
|
9
11
|
|
12
|
+
def test_port
|
13
|
+
assert_equal('http://test.host:1271/c/a/i',
|
14
|
+
@rewriter.rewrite(:controller => 'c', :action => 'a', :id => 'i', :port => 1271)
|
15
|
+
)
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_protocol_with_and_without_separator
|
19
|
+
assert_equal('https://test.host/c/a/i',
|
20
|
+
@rewriter.rewrite(:protocol => 'https', :controller => 'c', :action => 'a', :id => 'i')
|
21
|
+
)
|
22
|
+
|
23
|
+
assert_equal('https://test.host/c/a/i',
|
24
|
+
@rewriter.rewrite(:protocol => 'https://', :controller => 'c', :action => 'a', :id => 'i')
|
25
|
+
)
|
26
|
+
end
|
27
|
+
|
28
|
+
def test_user_name_and_password
|
29
|
+
assert_equal(
|
30
|
+
'http://david:secret@test.host/c/a/i',
|
31
|
+
@rewriter.rewrite(:user => "david", :password => "secret", :controller => 'c', :action => 'a', :id => 'i')
|
32
|
+
)
|
33
|
+
end
|
34
|
+
|
35
|
+
def test_user_name_and_password_with_escape_codes
|
36
|
+
assert_equal(
|
37
|
+
'http://openid.aol.com%2Fnextangler:one+two%3F@test.host/c/a/i',
|
38
|
+
@rewriter.rewrite(:user => "openid.aol.com/nextangler", :password => "one two?", :controller => 'c', :action => 'a', :id => 'i')
|
39
|
+
)
|
40
|
+
end
|
41
|
+
|
42
|
+
def test_anchor
|
43
|
+
assert_equal(
|
44
|
+
'http://test.host/c/a/i#anchor',
|
45
|
+
@rewriter.rewrite(:controller => 'c', :action => 'a', :id => 'i', :anchor => 'anchor')
|
46
|
+
)
|
47
|
+
end
|
48
|
+
|
10
49
|
def test_overwrite_params
|
11
50
|
@params[:controller] = 'hi'
|
12
51
|
@params[:action] = 'bye'
|
@@ -17,11 +56,32 @@ class UrlRewriterTests < Test::Unit::TestCase
|
|
17
56
|
assert_match %r(/hi/hi/2$), u
|
18
57
|
end
|
19
58
|
|
20
|
-
def
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
59
|
+
def test_overwrite_removes_original
|
60
|
+
@params[:controller] = 'search'
|
61
|
+
@params[:action] = 'list'
|
62
|
+
@params[:list_page] = 1
|
63
|
+
|
64
|
+
assert_equal '/search/list?list_page=2', @rewriter.rewrite(:only_path => true, :overwrite_params => {"list_page" => 2})
|
65
|
+
u = @rewriter.rewrite(:only_path => false, :overwrite_params => {:list_page => 2})
|
66
|
+
assert_equal 'http://test.host/search/list?list_page=2', u
|
67
|
+
end
|
68
|
+
|
69
|
+
def test_to_str
|
70
|
+
@params[:controller] = 'hi'
|
71
|
+
@params[:action] = 'bye'
|
72
|
+
@request.parameters[:id] = '2'
|
73
|
+
|
74
|
+
assert_equal 'http://, test.host, /, hi, bye, {"id"=>"2"}', @rewriter.to_str
|
75
|
+
end
|
76
|
+
|
77
|
+
def test_trailing_slash
|
78
|
+
options = {:controller => 'foo', :action => 'bar', :id => '3', :only_path => true}
|
79
|
+
assert_equal '/foo/bar/3', @rewriter.rewrite(options)
|
80
|
+
assert_equal '/foo/bar/3?query=string', @rewriter.rewrite(options.merge({:query => 'string'}))
|
81
|
+
options.update({:trailing_slash => true})
|
82
|
+
assert_equal '/foo/bar/3/', @rewriter.rewrite(options)
|
83
|
+
options.update({:query => 'string'})
|
84
|
+
assert_equal '/foo/bar/3/?query=string', @rewriter.rewrite(options)
|
25
85
|
end
|
26
86
|
end
|
27
87
|
|
@@ -44,6 +104,12 @@ class UrlWriterTests < Test::Unit::TestCase
|
|
44
104
|
W.new.url_for :controller => 'c', :action => 'a', :id => 'i'
|
45
105
|
end
|
46
106
|
end
|
107
|
+
|
108
|
+
def test_anchor
|
109
|
+
assert_equal('/c/a#anchor',
|
110
|
+
W.new.url_for(:only_path => true, :controller => 'c', :action => 'a', :anchor => 'anchor')
|
111
|
+
)
|
112
|
+
end
|
47
113
|
|
48
114
|
def test_default_host
|
49
115
|
add_host!
|
@@ -72,15 +138,20 @@ class UrlWriterTests < Test::Unit::TestCase
|
|
72
138
|
W.new.url_for(:controller => 'c', :action => 'a', :id => 'i', :protocol => 'https')
|
73
139
|
)
|
74
140
|
end
|
75
|
-
|
76
|
-
def
|
77
|
-
|
78
|
-
|
141
|
+
|
142
|
+
def test_protocol_with_and_without_separator
|
143
|
+
add_host!
|
144
|
+
assert_equal('https://www.basecamphq.com/c/a/i',
|
145
|
+
W.new.url_for(:controller => 'c', :action => 'a', :id => 'i', :protocol => 'https')
|
146
|
+
)
|
147
|
+
assert_equal('https://www.basecamphq.com/c/a/i',
|
148
|
+
W.new.url_for(:controller => 'c', :action => 'a', :id => 'i', :protocol => 'https://')
|
79
149
|
)
|
80
150
|
end
|
81
|
-
|
151
|
+
|
82
152
|
def test_named_route
|
83
153
|
ActionController::Routing::Routes.draw do |map|
|
154
|
+
map.no_args '/this/is/verbose', :controller => 'home', :action => 'index'
|
84
155
|
map.home '/home/sweet/home/:user', :controller => 'home', :action => 'index'
|
85
156
|
map.connect ':controller/:action/:id'
|
86
157
|
end
|
@@ -93,6 +164,8 @@ class UrlWriterTests < Test::Unit::TestCase
|
|
93
164
|
controller.send(:home_url, :host => 'www.basecamphq.com', :user => 'again')
|
94
165
|
|
95
166
|
assert_equal("/home/sweet/home/alabama", controller.send(:home_path, :user => 'alabama', :host => 'unused'))
|
167
|
+
assert_equal("http://www.basecamphq.com/home/sweet/home/alabama", controller.send(:home_url, :user => 'alabama', :host => 'www.basecamphq.com'))
|
168
|
+
assert_equal("http://www.basecamphq.com/this/is/verbose", controller.send(:no_args_url, :host=>'www.basecamphq.com'))
|
96
169
|
ensure
|
97
170
|
ActionController::Routing::Routes.load!
|
98
171
|
end
|
@@ -111,6 +184,7 @@ class UrlWriterTests < Test::Unit::TestCase
|
|
111
184
|
controller.send(:url_for, :controller => 'brave', :action => 'new', :id => 'world', :only_path => true)
|
112
185
|
|
113
186
|
assert_equal("/home/sweet/home/alabama", controller.send(:home_url, :user => 'alabama', :host => 'unused', :only_path => true))
|
187
|
+
assert_equal("/home/sweet/home/alabama", controller.send(:home_path, 'alabama'))
|
114
188
|
ensure
|
115
189
|
ActionController::Routing::Routes.load!
|
116
190
|
end
|
@@ -156,8 +230,8 @@ class UrlWriterTests < Test::Unit::TestCase
|
|
156
230
|
params = extract_params(url)
|
157
231
|
assert_equal params[0], { 'query[hobby]' => 'piercing' }.to_query
|
158
232
|
assert_equal params[1], { 'query[person][name]' => 'Bob' }.to_query
|
159
|
-
assert_equal params[2], { 'query[person][position][]' => '
|
160
|
-
assert_equal params[3], { 'query[person][position][]' => '
|
233
|
+
assert_equal params[2], { 'query[person][position][]' => 'prof' }.to_query
|
234
|
+
assert_equal params[3], { 'query[person][position][]' => 'art director' }.to_query
|
161
235
|
end
|
162
236
|
|
163
237
|
def test_path_generation_for_symbol_parameter_keys
|
@@ -168,4 +242,5 @@ class UrlWriterTests < Test::Unit::TestCase
|
|
168
242
|
def extract_params(url)
|
169
243
|
url.split('?', 2).last.split('&')
|
170
244
|
end
|
245
|
+
|
171
246
|
end
|