diff options
Diffstat (limited to 'actionpack/lib/action_controller')
6 files changed, 11 insertions, 3 deletions
diff --git a/actionpack/lib/action_controller/assertions/dom_assertions.rb b/actionpack/lib/action_controller/assertions/dom_assertions.rb index d1eea59ea0..355080fe54 100644 --- a/actionpack/lib/action_controller/assertions/dom_assertions.rb +++ b/actionpack/lib/action_controller/assertions/dom_assertions.rb @@ -1,7 +1,7 @@ module ActionController module Assertions module DomAssertions - # test 2 html strings to be equivalent, i.e. identical up to reordering of attributes + # Test two HTML strings for equivalency (e.g., identical up to reordering of attributes) def assert_dom_equal(expected, actual, message="") clean_backtrace do expected_dom = HTML::Document.new(expected).root @@ -11,7 +11,7 @@ module ActionController end end - # negated form of +assert_dom_equivalent+ + # The negated form of +assert_dom_equivalent+. def assert_dom_not_equal(expected, actual, message="") clean_backtrace do expected_dom = HTML::Document.new(expected).root diff --git a/actionpack/lib/action_controller/assertions/model_assertions.rb b/actionpack/lib/action_controller/assertions/model_assertions.rb index a9bcd7db9a..5fc5c81cb7 100644 --- a/actionpack/lib/action_controller/assertions/model_assertions.rb +++ b/actionpack/lib/action_controller/assertions/model_assertions.rb @@ -1,7 +1,7 @@ module ActionController module Assertions module ModelAssertions - # ensures that the passed record is valid by active record standards. returns the error messages if not + # Ensures that the passed record is valid by ActiveRecord standards and returns any error messages if it is not. def assert_valid(record) clean_backtrace do assert record.valid?, record.errors.full_messages.join("\n") diff --git a/actionpack/lib/action_controller/assertions/response_assertions.rb b/actionpack/lib/action_controller/assertions/response_assertions.rb index cf30569f36..de7efd0ac9 100644 --- a/actionpack/lib/action_controller/assertions/response_assertions.rb +++ b/actionpack/lib/action_controller/assertions/response_assertions.rb @@ -119,6 +119,7 @@ module ActionController end private + # Recognizes the route for a given path. def recognized_request_for(path, request_method = nil) path = "/#{path}" unless path.first == '/' @@ -131,6 +132,7 @@ module ActionController request end + # Proxy to to_param if the object will respond to it. def parameterize(value) value.respond_to?(:to_param) ? value.to_param : value end diff --git a/actionpack/lib/action_controller/assertions/routing_assertions.rb b/actionpack/lib/action_controller/assertions/routing_assertions.rb index 11a649c49a..6cd4d48b9e 100644 --- a/actionpack/lib/action_controller/assertions/routing_assertions.rb +++ b/actionpack/lib/action_controller/assertions/routing_assertions.rb @@ -82,6 +82,7 @@ module ActionController end private + # Recognizes the route for a given path. def recognized_request_for(path, request_method = nil) path = "/#{path}" unless path.first == '/' diff --git a/actionpack/lib/action_controller/mime_types.rb b/actionpack/lib/action_controller/mime_types.rb index 66a3133c4f..8273a2403b 100644 --- a/actionpack/lib/action_controller/mime_types.rb +++ b/actionpack/lib/action_controller/mime_types.rb @@ -1,3 +1,6 @@ +# Build list of Mime types for HTTP responses +# http://www.iana.org/assignments/media-types/ + Mime::Type.register "*/*", :all Mime::Type.register "text/plain", :text, [], %w(txt) Mime::Type.register "text/html", :html, %w( application/xhtml+xml ), %w( xhtml ) diff --git a/actionpack/lib/action_controller/url_rewriter.rb b/actionpack/lib/action_controller/url_rewriter.rb index 66b77e405f..88c7afff41 100644 --- a/actionpack/lib/action_controller/url_rewriter.rb +++ b/actionpack/lib/action_controller/url_rewriter.rb @@ -75,6 +75,7 @@ module ActionController alias_method :to_s, :to_str private + # Given a path and options, returns a rewritten URL string def rewrite_url(options) rewritten_url = "" @@ -94,6 +95,7 @@ module ActionController rewritten_url end + # Given a Hash of options, generates a route def rewrite_path(options) options = options.symbolize_keys options.update(options[:params].symbolize_keys) if options[:params] |