Permalink
Browse files

update Rails

  • Loading branch information...
jweiss committed Mar 8, 2010
1 parent cd4a384 commit 098f41c6c90c2bcac7591b9456ae9dd966301012
Showing with 3,732 additions and 602 deletions.
  1. +2 −0 CHANGELOG.txt
  2. +1 −1 config/environment.rb
  3. +4 −0 vendor/rails/actionmailer/CHANGELOG
  4. +1 −1 vendor/rails/actionmailer/Rakefile
  5. +2 −0 vendor/rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3/tmail/parser.rb
  6. +1 −1 vendor/rails/actionmailer/lib/action_mailer/version.rb
  7. +1 −0 vendor/rails/actionmailer/lib/actionmailer.rb
  8. +1 −1 vendor/rails/actionmailer/test/fixtures/helpers/example_helper.rb
  9. +3 −1 vendor/rails/actionmailer/test/mail_service_test.rb
  10. +12 −0 vendor/rails/actionpack/CHANGELOG
  11. +1 −1 vendor/rails/actionpack/Rakefile
  12. +3 −1 vendor/rails/actionpack/lib/action_controller.rb
  13. +19 −3 vendor/rails/actionpack/lib/action_controller/assertions/dom_assertions.rb
  14. +16 −10 vendor/rails/actionpack/lib/action_controller/assertions/selector_assertions.rb
  15. +1 −1 vendor/rails/actionpack/lib/action_controller/base.rb
  16. +1 −0 vendor/rails/actionpack/lib/action_controller/caching.rb
  17. +2 −1 vendor/rails/actionpack/lib/action_controller/cookies.rb
  18. +3 −2 vendor/rails/actionpack/lib/action_controller/http_authentication.rb
  19. +15 −3 vendor/rails/actionpack/lib/action_controller/integration.rb
  20. +6 −1 vendor/rails/actionpack/lib/action_controller/layout.rb
  21. +2 −0 vendor/rails/actionpack/lib/action_controller/middlewares.rb
  22. +6 −21 vendor/rails/actionpack/lib/action_controller/polymorphic_routes.rb
  23. +36 −0 vendor/rails/actionpack/lib/action_controller/rack_lint_patch.rb
  24. +6 −2 vendor/rails/actionpack/lib/action_controller/request_forgery_protection.rb
  25. +2 −1 vendor/rails/actionpack/lib/action_controller/response.rb
  26. +29 −0 vendor/rails/actionpack/lib/action_controller/string_coercion.rb
  27. +6 −1 vendor/rails/actionpack/lib/action_controller/test_case.rb
  28. +1 −1 vendor/rails/actionpack/lib/action_controller/test_process.rb
  29. +2 −2 vendor/rails/actionpack/lib/action_controller/translation.rb
  30. +2 −2 vendor/rails/actionpack/lib/action_controller/uploaded_file.rb
  31. +1 −1 vendor/rails/actionpack/lib/action_controller/vendor/html-scanner/html/node.rb
  32. +1 −1 vendor/rails/actionpack/lib/action_pack/version.rb
  33. +3 −3 vendor/rails/actionpack/lib/action_view.rb
  34. +6 −1 vendor/rails/actionpack/lib/action_view/base.rb
  35. +6 −0 vendor/rails/actionpack/lib/action_view/erb/util.rb
  36. +2 −0 vendor/rails/actionpack/lib/action_view/helpers.rb
  37. +3 −3 vendor/rails/actionpack/lib/action_view/helpers/active_record_helper.rb
  38. +2 −2 vendor/rails/actionpack/lib/action_view/helpers/asset_tag_helper.rb
  39. +2 −2 vendor/rails/actionpack/lib/action_view/helpers/capture_helper.rb
  40. +27 −15 vendor/rails/actionpack/lib/action_view/helpers/date_helper.rb
  41. +32 −11 vendor/rails/actionpack/lib/action_view/helpers/form_helper.rb
  42. +1 −1 vendor/rails/actionpack/lib/action_view/helpers/form_options_helper.rb
  43. +3 −3 vendor/rails/actionpack/lib/action_view/helpers/form_tag_helper.rb
  44. +6 −1 vendor/rails/actionpack/lib/action_view/helpers/number_helper.rb
  45. +1 −1 vendor/rails/actionpack/lib/action_view/helpers/prototype_helper.rb
  46. +9 −0 vendor/rails/actionpack/lib/action_view/helpers/raw_output_helper.rb
  47. +10 −2 vendor/rails/actionpack/lib/action_view/helpers/sanitize_helper.rb
  48. +4 −4 vendor/rails/actionpack/lib/action_view/helpers/tag_helper.rb
  49. +1 −1 vendor/rails/actionpack/lib/action_view/helpers/translation_helper.rb
  50. +3 −3 vendor/rails/actionpack/lib/action_view/helpers/url_helper.rb
  51. +3 −0 vendor/rails/actionpack/lib/action_view/locale/en.yml
  52. +1 −1 vendor/rails/actionpack/lib/action_view/partials.rb
  53. +28 −0 vendor/rails/actionpack/lib/action_view/safe_buffer.rb
  54. +8 −2 vendor/rails/actionpack/lib/action_view/template.rb
  55. +102 −27 vendor/rails/actionpack/lib/action_view/test_case.rb
  56. +1 −0 vendor/rails/actionpack/lib/actionpack.rb
  57. +7 −0 vendor/rails/actionpack/test/controller/cookie_test.rb
  58. +53 −0 vendor/rails/actionpack/test/controller/dom_assertions_test.rb
  59. +1 −0 vendor/rails/actionpack/test/controller/filter_params_test.rb
  60. +1 −0 vendor/rails/actionpack/test/controller/html-scanner/sanitizer_test.rb
  61. +22 −0 vendor/rails/actionpack/test/controller/http_digest_authentication_test.rb
  62. +38 −0 vendor/rails/actionpack/test/controller/integration_test.rb
  63. +11 −0 vendor/rails/actionpack/test/controller/layout_test.rb
  64. +4 −0 vendor/rails/actionpack/test/controller/polymorphic_routes_test.rb
  65. +19 −1 vendor/rails/actionpack/test/controller/request_forgery_protection_test.rb
  66. +23 −15 vendor/rails/actionpack/test/controller/routing_test.rb
  67. +2 −2 vendor/rails/actionpack/test/controller/session/test_session_test.rb
  68. +1 −0 vendor/rails/actionpack/test/fixtures/layout_tests/abs_path_layout.rhtml
  69. +1 −0 vendor/rails/actionpack/test/fixtures/test/_from_helper.erb
  70. +1 −1 vendor/rails/actionpack/test/template/active_record_helper_test.rb
  71. +12 −0 vendor/rails/actionpack/test/template/asset_tag_helper_test.rb
  72. +6 −6 vendor/rails/actionpack/test/template/benchmark_helper_test.rb
  73. +2 −1 vendor/rails/actionpack/test/template/compiled_templates_test.rb
  74. +10 −9 vendor/rails/actionpack/test/template/date_helper_i18n_test.rb
  75. +29 −13 vendor/rails/actionpack/test/template/date_helper_test.rb
  76. +90 −10 vendor/rails/actionpack/test/template/form_helper_test.rb
  77. +4 −0 vendor/rails/actionpack/test/template/number_helper_test.rb
  78. +21 −0 vendor/rails/actionpack/test/template/raw_output_helper_test.rb
  79. +10 −1 vendor/rails/actionpack/test/template/sanitize_helper_test.rb
  80. +1 −0 vendor/rails/actionpack/test/template/tag_helper_test.rb
  81. +36 −0 vendor/rails/actionpack/test/view/safe_buffer_test.rb
  82. +173 −5 vendor/rails/actionpack/test/view/test_case_test.rb
  83. +8 −0 vendor/rails/activerecord/CHANGELOG
  84. +1 −1 vendor/rails/activerecord/Rakefile
  85. +10 −7 vendor/rails/activerecord/lib/active_record/associations.rb
  86. +7 −8 vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb
  87. +2 −2 vendor/rails/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb
  88. +9 −0 vendor/rails/activerecord/lib/active_record/associations/has_one_association.rb
  89. +32 −23 vendor/rails/activerecord/lib/active_record/autosave_association.rb
  90. +7 −0 vendor/rails/activerecord/lib/active_record/base.rb
  91. +6 −2 vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
  92. +1 −1 vendor/rails/activerecord/lib/active_record/fixtures.rb
  93. +0 −33 vendor/rails/activerecord/lib/active_record/locking/optimistic.rb
  94. +0 −22 vendor/rails/activerecord/lib/active_record/locking/pessimistic.rb
  95. +101 −38 vendor/rails/activerecord/lib/active_record/nested_attributes.rb
  96. +35 −35 vendor/rails/activerecord/lib/active_record/validations.rb
  97. +1 −1 vendor/rails/activerecord/lib/active_record/version.rb
  98. +1 −0 vendor/rails/activerecord/lib/activerecord.rb
  99. +12 −0 vendor/rails/activerecord/test/cases/associations/has_many_associations_test.rb
  100. +22 −0 vendor/rails/activerecord/test/cases/associations/has_many_through_associations_test.rb
  101. +21 −0 vendor/rails/activerecord/test/cases/associations/has_one_associations_test.rb
  102. +230 −11 vendor/rails/activerecord/test/cases/autosave_association_test.rb
  103. +2 −0 vendor/rails/activerecord/test/cases/base_test.rb
  104. +8 −0 vendor/rails/activerecord/test/cases/connection_test_mysql.rb
  105. +2 −2 vendor/rails/activerecord/test/cases/fixtures_test.rb
  106. +0 −18 vendor/rails/activerecord/test/cases/locking_test.rb
  107. +109 −37 vendor/rails/activerecord/test/cases/nested_attributes_test.rb
  108. +3 −3 vendor/rails/activerecord/test/cases/reflection_test.rb
  109. +8 −0 vendor/rails/activerecord/test/cases/validations_i18n_test.rb
  110. +37 −9 vendor/rails/activerecord/test/cases/validations_test.rb
  111. +1 −0 vendor/rails/activerecord/test/fixtures/accounts.yml
  112. BIN vendor/rails/activerecord/test/fixtures/fixture_database.sqlite3
  113. BIN vendor/rails/activerecord/test/fixtures/fixture_database_2.sqlite3
  114. +10 −0 vendor/rails/activerecord/test/models/company.rb
  115. +9 −2 vendor/rails/activerecord/test/models/pirate.rb
  116. +2 −0 vendor/rails/activerecord/test/models/treasure.rb
  117. +12 −0 vendor/rails/activerecord/test/schema/mysql_specific_schema.rb
  118. +1 −0 vendor/rails/activerecord/test/schema/schema.rb
  119. +9 −0 vendor/rails/activeresource/CHANGELOG
  120. +1 −1 vendor/rails/activeresource/Rakefile
  121. +2 −2 vendor/rails/activeresource/lib/active_resource/validations.rb
  122. +1 −1 vendor/rails/activeresource/lib/active_resource/version.rb
  123. +1 −0 vendor/rails/activeresource/lib/activeresource.rb
  124. +2 −2 vendor/rails/activeresource/test/base_errors_test.rb
  125. +1,728 −0 vendor/rails/activeresource/test/debug.log
  126. +8 −0 vendor/rails/activesupport/CHANGELOG
  127. +7 −0 vendor/rails/activesupport/lib/active_support/cache.rb
  128. +5 −0 vendor/rails/activesupport/lib/active_support/cache/mem_cache_store.rb
  129. +5 −5 vendor/rails/activesupport/lib/active_support/cache/strategy/local_cache.rb
  130. +7 −3 vendor/rails/activesupport/lib/active_support/core_ext.rb
  131. +2 −58 vendor/rails/activesupport/lib/active_support/core_ext/blank.rb
  132. +1 −0 vendor/rails/activesupport/lib/active_support/core_ext/kernel/debugger.rb
  133. +3 −1 vendor/rails/activesupport/lib/active_support/core_ext/name_error.rb
  134. +1 −0 vendor/rails/activesupport/lib/active_support/core_ext/object.rb
  135. +58 −0 vendor/rails/activesupport/lib/active_support/core_ext/object/blank.rb
  136. +2 −0 vendor/rails/activesupport/lib/active_support/core_ext/string.rb
  137. +48 −0 vendor/rails/activesupport/lib/active_support/core_ext/string/output_safety.rb
  138. +2 −1 vendor/rails/activesupport/lib/active_support/core_ext/time/calculations.rb
  139. +1 −1 vendor/rails/activesupport/lib/active_support/deprecation.rb
  140. +2 −3 vendor/rails/activesupport/lib/active_support/json/backends/jsongem.rb
  141. +1 −5 vendor/rails/activesupport/lib/active_support/json/backends/yaml.rb
  142. +2 −0 vendor/rails/activesupport/lib/active_support/json/decoding.rb
  143. +30 −10 vendor/rails/activesupport/lib/active_support/message_verifier.rb
  144. +1 −1 vendor/rails/activesupport/lib/active_support/multibyte/chars.rb
  145. +4 −4 vendor/rails/activesupport/lib/active_support/multibyte/utils.rb
  146. +7 −0 vendor/rails/activesupport/lib/active_support/ordered_hash.rb
  147. +2 −2 vendor/rails/activesupport/lib/active_support/vendor.rb
  148. +1 −1 vendor/rails/activesupport/lib/active_support/version.rb
  149. +8 −2 vendor/rails/activesupport/lib/active_support/whiny_nil.rb
  150. +13 −21 vendor/rails/activesupport/lib/active_support/xml_mini/nokogiri.rb
  151. +1 −0 vendor/rails/activesupport/lib/activesupport.rb
  152. +6 −0 vendor/rails/railties/CHANGELOG
  153. +6 −6 vendor/rails/railties/Rakefile
  154. +1 −1 vendor/rails/railties/lib/commands/plugin.rb
  155. +2 −0 vendor/rails/railties/lib/rails/rack/debugger.rb
  156. +1 −1 vendor/rails/railties/lib/rails/version.rb
  157. +7 −7 vendor/rails/railties/lib/rails_generator/options.rb
  158. +2 −1 vendor/rails/railties/lib/tasks/rails.rb
View
@@ -1,6 +1,8 @@
edge
+* Update to Rails 2.3.5
+
* When cloning, also clone roles. Provided by Sergio Cambra.
* Update to Rails 2.3.4
View
@@ -5,7 +5,7 @@
# ENV['RAILS_ENV'] ||= 'production'
# Specifies gem version of Rails to use when vendor/rails is not present
-RAILS_GEM_VERSION = '2.3.4' unless defined? RAILS_GEM_VERSION
+RAILS_GEM_VERSION = '2.3.5' unless defined? RAILS_GEM_VERSION
# Bootstrap the Rails environment, frameworks, and default configuration
require File.join(File.dirname(__FILE__), 'boot')
@@ -1,3 +1,7 @@
+*2.3.5 (November 25, 2009)*
+
+* Minor Bug Fixes and deprecation warnings
+
*2.3.4 (September 4, 2009)*
* Minor bug fixes.
@@ -54,7 +54,7 @@ spec = Gem::Specification.new do |s|
s.rubyforge_project = "actionmailer"
s.homepage = "http://www.rubyonrails.org"
- s.add_dependency('actionpack', '= 2.3.4' + PKG_BUILD)
+ s.add_dependency('actionpack', '= 2.3.5' + PKG_BUILD)
s.has_rdoc = true
s.requirements << 'none'
@@ -43,6 +43,7 @@ module Racc
class Parser
+ old_verbose, $VERBOSE = $VERBOSE, nil
Racc_Runtime_Version = '1.4.5'
Racc_Runtime_Revision = '$Revision: 1.7 $'.split[1]
@@ -71,6 +72,7 @@ class Parser
Racc_Runtime_Core_Revision = Racc_Runtime_Core_Revision_R
Racc_Runtime_Type = 'ruby'
end
+ $VERBOSE = old_verbose
def Parser.racc_runtime_type
Racc_Runtime_Type
@@ -2,7 +2,7 @@ module ActionMailer
module VERSION #:nodoc:
MAJOR = 2
MINOR = 3
- TINY = 4
+ TINY = 5
STRING = [MAJOR, MINOR, TINY].join('.')
end
@@ -1 +1,2 @@
require 'action_mailer'
+ActiveSupport::Deprecation.warn 'require "actionmailer" is deprecated and will be removed in Rails 3. Use require "action_mailer" instead.'
@@ -1,5 +1,5 @@
module ExampleHelper
def example_format(text)
- "<em><strong><small>#{text}</small></strong></em>"
+ "<em><strong><small>#{h(text)}</small></strong></em>".html_safe!
end
end
@@ -570,7 +570,9 @@ def test_delivery_logs_sent_mail
mail = TestMailer.create_signed_up(@recipient)
logger = mock()
logger.expects(:info).with("Sent mail to #{@recipient}")
- logger.expects(:debug).with("\n#{mail.encoded}")
+ logger.expects(:debug).with() do |logged_text|
+ logged_text =~ /\[Signed up\] Welcome/
+ end
TestMailer.logger = logger
TestMailer.deliver_signed_up(@recipient)
end
@@ -1,3 +1,15 @@
+*2.3.5 (November 25, 2009)*
+
+* Minor Bug Fixes and deprecation warnings
+
+* Ruby 1.9 Support
+
+* Fix filtering parameters when there are Fixnum or other un-dupable values.
+
+* Improvements to ActionView::TestCase
+
+* Compatiblity with the rails_xss plugin
+
*2.3.4 (September 4, 2009)*
* Sanitize multibyte strings before escaping them with escape_once. CVE-2009-3009
@@ -79,7 +79,7 @@ spec = Gem::Specification.new do |s|
s.has_rdoc = true
s.requirements << 'none'
- s.add_dependency('activesupport', '= 2.3.4' + PKG_BUILD)
+ s.add_dependency('activesupport', '= 2.3.5' + PKG_BUILD)
s.add_dependency('rack', '~> 1.0.0')
s.require_path = 'lib'
@@ -31,8 +31,9 @@
end
end
-gem 'rack', '~> 1.0.0'
+gem 'rack', '~> 1.0.1'
require 'rack'
+require 'action_controller/cgi_ext'
module ActionController
# TODO: Review explicit to see if they will automatically be handled by
@@ -70,6 +71,7 @@ def self.load_all!
autoload :SessionManagement, 'action_controller/session_management'
autoload :StatusCodes, 'action_controller/status_codes'
autoload :Streaming, 'action_controller/streaming'
+ autoload :StringCoercion, 'action_controller/string_coercion'
autoload :TestCase, 'action_controller/test_case'
autoload :TestProcess, 'action_controller/test_process'
autoload :Translation, 'action_controller/translation'
@@ -1,6 +1,18 @@
module ActionController
module Assertions
module DomAssertions
+ def self.strip_whitespace!(nodes)
+ nodes.reject! do |node|
+ if node.is_a?(HTML::Text)
+ node.content.strip!
+ node.content.empty?
+ else
+ strip_whitespace! node.children
+ false
+ end
+ end
+ end
+
# Test two HTML strings for equivalency (e.g., identical up to reordering of attributes)
#
# ==== Examples
@@ -12,13 +24,15 @@ def assert_dom_equal(expected, actual, message = "")
clean_backtrace do
expected_dom = HTML::Document.new(expected).root
actual_dom = HTML::Document.new(actual).root
- full_message = build_message(message, "<?> expected to be == to\n<?>.", expected_dom.to_s, actual_dom.to_s)
+ DomAssertions.strip_whitespace!(expected_dom.children)
+ DomAssertions.strip_whitespace!(actual_dom.children)
+ full_message = build_message(message, "<?> expected but was\n<?>.", expected_dom.to_s, actual_dom.to_s)
assert_block(full_message) { expected_dom == actual_dom }
end
end
- # The negated form of +assert_dom_equivalent+.
+ # The negated form of +assert_dom_equal+.
#
# ==== Examples
#
@@ -29,8 +43,10 @@ def assert_dom_not_equal(expected, actual, message = "")
clean_backtrace do
expected_dom = HTML::Document.new(expected).root
actual_dom = HTML::Document.new(actual).root
- full_message = build_message(message, "<?> expected to be != to\n<?>.", expected_dom.to_s, actual_dom.to_s)
+ DomAssertions.strip_whitespace!(expected_dom.children)
+ DomAssertions.strip_whitespace!(actual_dom.children)
+ full_message = build_message(message, "<?> expected to be != to\n<?>.", expected_dom.to_s, actual_dom.to_s)
assert_block(full_message) { expected_dom != actual_dom }
end
end
@@ -16,14 +16,20 @@ module Assertions
#
# Use +css_select+ to select elements without making an assertions, either
# from the response HTML or elements selected by the enclosing assertion.
- #
+ #
# In addition to HTML responses, you can make the following assertions:
# * +assert_select_rjs+ - Assertions on HTML content of RJS update and insertion operations.
# * +assert_select_encoded+ - Assertions on HTML encoded inside XML, for example for dealing with feed item descriptions.
# * +assert_select_email+ - Assertions on the HTML body of an e-mail.
#
# Also see HTML::Selector to learn how to use selectors.
module SelectorAssertions
+
+ def initialize(*args)
+ super
+ @selected = nil
+ end
+
# :call-seq:
# css_select(selector) => array
# css_select(element, selector) => array
@@ -53,8 +59,8 @@ module SelectorAssertions
# end
#
# # Selects all list items in unordered lists
- # items = css_select("ul>li")
- #
+ # items = css_select("ul>li")
+ #
# # Selects all form tags and then all inputs inside the form
# forms = css_select("form")
# forms.each do |form|
@@ -212,7 +218,7 @@ def assert_select(*args, &block)
# Otherwise just operate on the response document.
root = response_from_page_or_rjs
end
-
+
# First or second argument is the selector: string and we pass
# all remaining arguments. Array and we pass the argument. Also
# accepts selector itself.
@@ -225,7 +231,7 @@ def assert_select(*args, &block)
selector = arg
else raise ArgumentError, "Expecting a selector as the first argument"
end
-
+
# Next argument is used for equality tests.
equals = {}
case arg = args.shift
@@ -315,10 +321,10 @@ def assert_select(*args, &block)
# Returns all matches elements.
matches
end
-
+
def count_description(min, max) #:nodoc:
pluralize = lambda {|word, quantity| word << (quantity == 1 ? '' : 's')}
-
+
if min && max && (max != min)
"between #{min} and #{max} elements"
elsif min && !(min == 1 && max == 1)
@@ -327,7 +333,7 @@ def count_description(min, max) #:nodoc:
"at most #{max} #{pluralize['element', max]}"
end
end
-
+
# :call-seq:
# assert_select_rjs(id?) { |elements| ... }
# assert_select_rjs(statement, id?) { |elements| ... }
@@ -344,7 +350,7 @@ def count_description(min, max) #:nodoc:
# that update or insert an element with that identifier.
#
# Use the first argument to narrow down assertions to only statements
- # of that type. Possible values are <tt>:replace</tt>, <tt>:replace_html</tt>,
+ # of that type. Possible values are <tt>:replace</tt>, <tt>:replace_html</tt>,
# <tt>:show</tt>, <tt>:hide</tt>, <tt>:toggle</tt>, <tt>:remove</tt> and
# <tt>:insert_html</tt>.
#
@@ -488,7 +494,7 @@ def assert_select_rjs(*args, &block)
# end
# end
# end
- #
+ #
#
# # Selects all paragraph tags from within the description of an RSS feed
# assert_select_feed :rss, 2.0 do
@@ -502,7 +502,7 @@ def filter_parameter_logging(*filter_words, &block)
end
elsif block_given?
key = key.dup
- value = value.dup if value
+ value = value.dup if value.duplicable?
yield key, value
filtered_parameters[key] = value
else
@@ -22,6 +22,7 @@ module ActionController #:nodoc:
# ActionController::Base.cache_store = :file_store, "/path/to/cache/directory"
# ActionController::Base.cache_store = :drb_store, "druby://localhost:9192"
# ActionController::Base.cache_store = :mem_cache_store, "localhost"
+ # ActionController::Base.cache_store = :mem_cache_store, Memcached::Rails.new("localhost:11211")
# ActionController::Base.cache_store = MyOwnStore.new("parameter")
module Caching
autoload :Actions, 'action_controller/caching/actions'
@@ -87,8 +87,9 @@ def []=(key, options)
def delete(key, options = {})
options.symbolize_keys!
options[:path] = "/" unless options.has_key?(:path)
- super(key.to_s)
+ value = super(key.to_s)
@controller.response.delete_cookie(key, options)
+ value
end
end
end
@@ -227,9 +227,9 @@ def decode_credentials_header(request)
end
def decode_credentials(header)
- header.to_s.gsub(/^Digest\s+/,'').split(',').inject({}) do |hash, pair|
+ header.to_s.gsub(/^Digest\s+/,'').split(',').inject({}.with_indifferent_access) do |hash, pair|
key, value = pair.split('=', 2)
- hash[key.strip.to_sym] = value.to_s.gsub(/^"|"$/,'').gsub(/'/, '')
+ hash[key.strip] = value.to_s.gsub(/^"|"$/,'').gsub(/'/, '')
hash
end
end
@@ -289,6 +289,7 @@ def nonce(time = Time.now)
# allow a user to use new nonce without prompting user again for their
# username and password.
def validate_nonce(request, value, seconds_to_timeout=5*60)
+ return false if value.nil?
t = Base64.decode64(value).split(":").first.to_i
nonce(t) == value && (t - Time.now.to_i).abs <= seconds_to_timeout
end
@@ -1,6 +1,7 @@
require 'stringio'
require 'uri'
require 'active_support/test_case'
+require 'action_controller/rack_lint_patch'
module ActionController
module Integration #:nodoc:
@@ -268,7 +269,9 @@ def process(method, path, parameters = nil, headers = nil)
env["QUERY_STRING"] ||= ""
- data = data.is_a?(IO) ? data : StringIO.new(data || '')
+ data ||= ''
+ data.force_encoding(Encoding::ASCII_8BIT) if data.respond_to?(:force_encoding)
+ data = data.is_a?(IO) ? data : StringIO.new(data)
env.update(
"REQUEST_METHOD" => method.to_s.upcase,
@@ -476,6 +479,11 @@ def new_with_capture(*args)
end
module Runner
+ def initialize(*args)
+ super
+ @integration_session = nil
+ end
+
# Reset the current session. This is useful for testing multiple sessions
# in a single test case.
def reset!
@@ -543,8 +551,12 @@ def copy_session_variables! #:nodoc:
# Delegate unhandled messages to the current session instance.
def method_missing(sym, *args, &block)
reset! unless @integration_session
- returning @integration_session.__send__(sym, *args, &block) do
- copy_session_variables!
+ if @integration_session.respond_to?(sym)
+ returning @integration_session.__send__(sym, *args, &block) do
+ copy_session_variables!
+ end
+ else
+ super
end
end
end
@@ -194,6 +194,11 @@ def normalize_conditions(conditions)
end
end
+ def initialize(*args)
+ super
+ @real_format = nil
+ end
+
# Returns the name of the active layout. If the layout was specified as a method reference (through a symbol), this method
# is called and the return value is used. Likewise if the layout was specified as an inline method (through a proc or method
# object). If the layout was defined without a directory, layouts is assumed. So <tt>layout "weblog/standard"</tt> will return
@@ -221,7 +226,7 @@ def default_layout #:nodoc:
end
def find_layout(layout, format, html_fallback=false) #:nodoc:
- view_paths.find_template(layout.to_s =~ /layouts\// ? layout : "layouts/#{layout}", format, html_fallback)
+ view_paths.find_template(layout.to_s =~ /\A\/|layouts\// ? layout : "layouts/#{layout}", format, html_fallback)
rescue ActionView::MissingTemplate
raise if Mime::Type.lookup_by_extension(format.to_s).html?
end
@@ -10,3 +10,5 @@
use "ActionController::ParamsParser"
use "Rack::MethodOverride"
use "Rack::Head"
+
+use "ActionController::StringCoercion"
Oops, something went wrong.

0 comments on commit 098f41c

Please sign in to comment.