Permalink
Browse files

Merge branch 'master' into jobs

* master: (67 commits)
  take into account multipart when calculating tag attributes
  ask the form builder for form tag attributes
  do not mutate the options hash (when we do not need to)
  remove unnecessary #dup
  replace #flatten with Array()
  Cleanup some unnecessary CSS on the new error page and reformat some lines.
  refactoring to_sym of Symbol in preload
  add source line padding
  allow toggling dumps instead of just showing
  No need to pass a empty block to content_tag_for anymore
  Make content_tag_for work without block
  Add missing changelog entry for #8676 [ci skip]
  remove meaningless AS::FrozenObjectError
  Standardize the use of current_adapter?
  Address a failure test_remove_column_with_multi_column_index with Oracle database
  unused scope
  Add entry in Releases Notes about changes in exceptions page
  Add CHANGELOG entry for changes in exception pages
  update rake tasks output [ci skip]
  fix alignment in rails info properties page [ci skip]
  ...
  • Loading branch information...
2 parents 214793a + 8890fb8 commit 47e0d3c39f4365e815870aaf09e8bce462e704a0 @tenderlove tenderlove committed Jan 2, 2013
Showing with 702 additions and 928 deletions.
  1. +1 −1 actionmailer/MIT-LICENSE
  2. +1 −1 actionmailer/lib/action_mailer.rb
  3. +0 −7 actionmailer/lib/action_mailer/test_case.rb
  4. +1 −1 actionmailer/test/abstract_unit.rb
  5. +0 −37 actionmailer/test/spec_type_test.rb
  6. +0 −144 actionmailer/test/test_test.rb
  7. +20 −0 actionpack/CHANGELOG.md
  8. +1 −1 actionpack/MIT-LICENSE
  9. +1 −0 actionpack/lib/action_controller/metal/head.rb
  10. +0 −7 actionpack/lib/action_controller/test_case.rb
  11. +1 −1 actionpack/lib/action_dispatch.rb
  12. +6 −2 actionpack/lib/action_dispatch/http/response.rb
  13. +1 −2 actionpack/lib/action_dispatch/journey/formatter.rb
  14. +57 −9 actionpack/lib/action_dispatch/middleware/cookies.rb
  15. +4 −1 actionpack/lib/action_dispatch/middleware/debug_exceptions.rb
  16. +22 −2 actionpack/lib/action_dispatch/middleware/exception_wrapper.rb
  17. +9 −6 actionpack/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb
  18. +25 −0 actionpack/lib/action_dispatch/middleware/templates/rescues/_source.erb
  19. +15 −9 actionpack/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb
  20. +98 −5 actionpack/lib/action_dispatch/middleware/templates/rescues/layout.erb
  21. +7 −2 actionpack/lib/action_dispatch/middleware/templates/rescues/missing_template.erb
  22. +22 −19 actionpack/lib/action_dispatch/middleware/templates/rescues/routing_error.erb
  23. +40 −13 actionpack/lib/action_dispatch/middleware/templates/rescues/template_error.erb
  24. +6 −2 actionpack/lib/action_dispatch/middleware/templates/rescues/unknown_action.erb
  25. +2 −2 actionpack/lib/action_dispatch/routing/mapper.rb
  26. +1 −1 actionpack/lib/action_dispatch/testing/assertions/dom.rb
  27. +0 −3 actionpack/lib/action_dispatch/testing/integration.rb
  28. +1 −1 actionpack/lib/action_pack.rb
  29. +1 −1 actionpack/lib/action_view.rb
  30. +8 −4 actionpack/lib/action_view/helpers/form_helper.rb
  31. +5 −1 actionpack/lib/action_view/helpers/record_tag_helper.rb
  32. +14 −6 actionpack/lib/action_view/template/error.rb
  33. +0 −3 actionpack/lib/action_view/test_case.rb
  34. +1 −1 actionpack/test/abstract_unit.rb
  35. +3 −3 actionpack/test/controller/http_token_authentication_test.rb
  36. +1 −1 actionpack/test/controller/live_stream_test.rb
  37. +14 −2 actionpack/test/controller/render_test.rb
  38. +0 −208 actionpack/test/controller/spec_style_test.rb
  39. +0 −37 actionpack/test/controller/spec_type_test.rb
  40. +1 −1 actionpack/test/dispatch/debug_exceptions_test.rb
  41. +1 −1 actionpack/test/dispatch/live_response_test.rb
  42. +1 −1 actionpack/test/dispatch/request/session_test.rb
  43. +1 −1 actionpack/test/dispatch/routing/inspector_test.rb
  44. +1 −1 actionpack/test/dispatch/session/abstract_store_test.rb
  45. +0 −41 actionpack/test/dispatch/spec_type_test.rb
  46. +1 −1 actionpack/test/dispatch/ssl_test.rb
  47. +1 −1 actionpack/test/journey/gtg/builder_test.rb
  48. +3 −3 actionpack/test/journey/gtg/transition_table_test.rb
  49. +6 −6 actionpack/test/journey/nfa/simulator_test.rb
  50. +1 −1 actionpack/test/journey/nfa/transition_table_test.rb
  51. +2 −2 actionpack/test/journey/nodes/symbol_test.rb
  52. +6 −6 actionpack/test/journey/path/pattern_test.rb
  53. +1 −1 actionpack/test/journey/route/definition/parser_test.rb
  54. +1 −1 actionpack/test/journey/route/definition/scanner_test.rb
  55. +2 −2 actionpack/test/journey/route_test.rb
  56. +1 −1 actionpack/test/journey/router/strexp_test.rb
  57. +1 −1 actionpack/test/journey/router/utils_test.rb
  58. +2 −2 actionpack/test/journey/router_test.rb
  59. +3 −3 actionpack/test/journey/routes_test.rb
  60. +19 −11 actionpack/test/template/record_tag_helper_test.rb
  61. +0 −39 actionpack/test/template/spec_type_test.rb
  62. +0 −56 actionpack/test/template/test_test.rb
  63. +1 −1 actionpack/test/ts_isolated.rb
  64. +1 −1 activemodel/MIT-LICENSE
  65. +1 −1 activemodel/lib/active_model.rb
  66. +1 −1 activemodel/test/cases/helper.rb
  67. +1 −1 activerecord/MIT-LICENSE
  68. +1 −1 activerecord/lib/active_record.rb
  69. +1 −1 activerecord/lib/active_record/aggregations.rb
  70. +3 −1 activerecord/lib/active_record/associations/preloader.rb
  71. +2 −2 activerecord/lib/active_record/railtie.rb
  72. +3 −1 activerecord/lib/active_record/railties/databases.rake
  73. +2 −2 activerecord/lib/active_record/relation/calculations.rb
  74. +10 −8 activerecord/lib/active_record/relation/spawn_methods.rb
  75. +1 −1 activerecord/test/cases/adapters/mysql/active_schema_test.rb
  76. +3 −0 activerecord/test/cases/adapters/postgresql/timestamp_test.rb
  77. +1 −2 activerecord/test/cases/aggregations_test.rb
  78. +1 −1 activerecord/test/cases/associations/belongs_to_associations_test.rb
  79. +5 −6 activerecord/test/cases/base_test.rb
  80. +5 −5 activerecord/test/cases/connection_adapters/abstract_adapter_test.rb
  81. +4 −4 activerecord/test/cases/connection_specification/resolver_test.rb
  82. +1 −1 activerecord/test/cases/defaults_test.rb
  83. +1 −2 activerecord/test/cases/helper.rb
  84. +9 −9 activerecord/test/cases/migration/change_schema_test.rb
  85. +1 −0 activerecord/test/cases/migration/change_table_test.rb
  86. +4 −4 activerecord/test/cases/migration/column_attributes_test.rb
  87. +3 −3 activerecord/test/cases/migration/index_test.rb
  88. +4 −4 activerecord/test/cases/migration/references_index_test.rb
  89. +8 −8 activerecord/test/cases/migration/references_statements_test.rb
  90. +3 −2 activerecord/test/cases/migration/rename_column_test.rb
  91. +2 −2 activerecord/test/cases/migration_test.rb
  92. +4 −4 activerecord/test/cases/migrator_test.rb
  93. +2 −3 activerecord/test/cases/persistence_test.rb
  94. +3 −3 activerecord/test/cases/primary_keys_test.rb
  95. +1 −1 activerecord/test/cases/query_cache_test.rb
  96. +2 −2 activerecord/test/cases/schema_dumper_test.rb
  97. +2 −2 activerecord/test/cases/transactions_test.rb
  98. +0 −2 activerecord/test/models/reply.rb
  99. +1 −1 activesupport/MIT-LICENSE
  100. +1 −1 activesupport/lib/active_support.rb
  101. +0 −1 activesupport/lib/active_support/cache.rb
  102. +0 −3 activesupport/lib/active_support/core_ext/exception.rb
  103. +1 −1 activesupport/lib/active_support/dependencies/autoload.rb
  104. +14 −28 activesupport/lib/active_support/test_case.rb
  105. +5 −0 activesupport/lib/active_support/testing/autorun.rb
  106. +40 −0 activesupport/lib/active_support/testing/declarative.rb
  107. +21 −0 activesupport/lib/active_support/time_with_zone.rb
  108. +1 −1 activesupport/test/abstract_unit.rb
  109. +2 −2 activesupport/test/core_ext/thread_test.rb
  110. +0 −22 activesupport/test/spec_type_test.rb
  111. +1 −1 activesupport/test/string_inquirer_test.rb
  112. +1 −1 activesupport/test/ts_isolated.rb
  113. +3 −4 activesupport/test/xml_mini/libxml_engine_test.rb
  114. +3 −4 activesupport/test/xml_mini/libxmlsax_engine_test.rb
  115. +3 −4 activesupport/test/xml_mini/nokogiri_engine_test.rb
  116. +3 −4 activesupport/test/xml_mini/nokogirisax_engine_test.rb
  117. +2 −0 guides/source/4_0_release_notes.md
  118. +1 −1 guides/source/command_line.md
  119. +3 −2 guides/source/contributing_to_ruby_on_rails.md
  120. +7 −5 guides/source/form_helpers.md
  121. +1 −1 guides/source/layouts_and_rendering.md
  122. +20 −1 guides/source/migrations.md
  123. +1 −1 guides/source/rails_on_rack.md
  124. +2 −2 guides/source/testing.md
  125. +1 −1 guides/source/working_with_javascript_in_rails.md
  126. +4 −0 railties/CHANGELOG.md
  127. +1 −1 railties/MIT-LICENSE
  128. +4 −3 railties/lib/rails/application.rb
  129. +1 −1 railties/lib/rails/generators/app_base.rb
  130. +1 −1 railties/lib/rails/generators/test_unit/plugin/templates/test_helper.rb
  131. +2 −2 railties/lib/rails/paths.rb
  132. +2 −0 railties/lib/rails/templates/layouts/application.html.erb
  133. +1 −1 railties/lib/rails/test_help.rb
  134. +1 −1 railties/test/abstract_unit.rb
  135. +1 −1 railties/test/application/assets_test.rb
  136. +2 −1 railties/test/configuration/middleware_stack_proxy_test.rb
  137. +1 −1 railties/test/engine_test.rb
  138. +1 −1 railties/test/isolation/abstract_unit.rb
  139. +1 −1 railties/test/railties/engine_test.rb
@@ -1,4 +1,4 @@
-Copyright (c) 2004-2012 David Heinemeier Hansson
+Copyright (c) 2004-2013 David Heinemeier Hansson
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@@ -1,5 +1,5 @@
#--
-# Copyright (c) 2004-2012 David Heinemeier Hansson
+# Copyright (c) 2004-2013 David Heinemeier Hansson
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -10,13 +10,6 @@ def initialize(name)
end
class TestCase < ActiveSupport::TestCase
-
- # Use AM::TestCase for the base class when describing a mailer
- register_spec_type(self) do |desc|
- Class === desc && desc < ActionMailer::Base
- end
- register_spec_type(/Mailer( ?Test)?\z/i, self)
-
module Behavior
extend ActiveSupport::Concern
@@ -8,7 +8,7 @@
Encoding.default_external = "UTF-8"
end
-require 'minitest/autorun'
+require 'active_support/testing/autorun'
require 'action_mailer'
require 'action_mailer/test_case'
require 'active_support/queueing'
@@ -1,37 +0,0 @@
-require 'abstract_unit'
-
-class NotificationMailer < ActionMailer::Base; end
-class Notifications < ActionMailer::Base; end
-
-class SpecTypeTest < ActiveSupport::TestCase
- def assert_mailer actual
- assert_equal ActionMailer::TestCase, actual
- end
-
- def refute_mailer actual
- refute_equal ActionMailer::TestCase, actual
- end
-
- def test_spec_type_resolves_for_class_constants
- assert_mailer MiniTest::Spec.spec_type(NotificationMailer)
- assert_mailer MiniTest::Spec.spec_type(Notifications)
- end
-
- def test_spec_type_resolves_for_matching_strings
- assert_mailer MiniTest::Spec.spec_type("WidgetMailer")
- assert_mailer MiniTest::Spec.spec_type("WidgetMailerTest")
- assert_mailer MiniTest::Spec.spec_type("Widget Mailer Test")
- # And is not case sensitive
- assert_mailer MiniTest::Spec.spec_type("widgetmailer")
- assert_mailer MiniTest::Spec.spec_type("widgetmailertest")
- assert_mailer MiniTest::Spec.spec_type("widget mailer test")
- end
-
- def test_spec_type_wont_match_non_space_characters
- refute_mailer MiniTest::Spec.spec_type("Widget Mailer\tTest")
- refute_mailer MiniTest::Spec.spec_type("Widget Mailer\rTest")
- refute_mailer MiniTest::Spec.spec_type("Widget Mailer\nTest")
- refute_mailer MiniTest::Spec.spec_type("Widget Mailer\fTest")
- refute_mailer MiniTest::Spec.spec_type("Widget MailerXTest")
- end
-end
@@ -26,147 +26,3 @@ def test_set_mailer_class_manual_using_string
assert_equal TestTestMailer, self.class.mailer_class
end
end
-
-describe TestTestMailer do
- it "gets the mailer from the test name" do
- assert_equal TestTestMailer, self.class.mailer_class
- end
-end
-
-describe TestTestMailer, :action do
- it "gets the mailer from the test name" do
- assert_equal TestTestMailer, self.class.mailer_class
- end
-end
-
-describe TestTestMailer do
- describe "nested" do
- it "gets the mailer from the test name" do
- assert_equal TestTestMailer, self.class.mailer_class
- end
- end
-end
-
-describe TestTestMailer, :action do
- describe "nested" do
- it "gets the mailer from the test name" do
- assert_equal TestTestMailer, self.class.mailer_class
- end
- end
-end
-
-describe "TestTestMailer" do
- it "gets the mailer from the test name" do
- assert_equal TestTestMailer, self.class.mailer_class
- end
-end
-
-describe "TestTestMailerTest" do
- it "gets the mailer from the test name" do
- assert_equal TestTestMailer, self.class.mailer_class
- end
-end
-
-describe "TestTestMailer" do
- describe "nested" do
- it "gets the mailer from the test name" do
- assert_equal TestTestMailer, self.class.mailer_class
- end
- end
-end
-
-describe "TestTestMailerTest" do
- describe "nested" do
- it "gets the mailer from the test name" do
- assert_equal TestTestMailer, self.class.mailer_class
- end
- end
-end
-
-describe "AnotherCrazySymbolNameMailerTest" do
- tests :test_test_mailer
-
- it "gets the mailer after setting it with a symbol" do
- assert_equal TestTestMailer, self.class.mailer_class
- end
-end
-
-describe "AnotherCrazyStringNameMailerTest" do
- tests 'test_test_mailer'
-
- it "gets the mailer after setting it with a string" do
- assert_equal TestTestMailer, self.class.mailer_class
- end
-end
-
-describe "Another Crazy Name Mailer Test" do
- tests TestTestMailer
-
- it "gets the mailer after setting it manually" do
- assert_equal TestTestMailer, self.class.mailer_class
- end
-end
-
-describe "Another Crazy Symbol Name Mailer Test" do
- tests :test_test_mailer
-
- it "gets the mailer after setting it with a symbol" do
- assert_equal TestTestMailer, self.class.mailer_class
- end
-end
-
-describe "Another Crazy String Name Mailer Test" do
- tests 'test_test_mailer'
-
- it "gets the mailer after setting it with a string" do
- assert_equal TestTestMailer, self.class.mailer_class
- end
-end
-
-describe "AnotherCrazySymbolNameMailerTest" do
- tests :test_test_mailer
-
- describe "nested" do
- it "gets the mailer after setting it with a symbol" do
- assert_equal TestTestMailer, self.class.mailer_class
- end
- end
-end
-
-describe "AnotherCrazyStringNameMailerTest" do
- tests 'test_test_mailer'
-
- describe "nested" do
- it "gets the mailer after setting it with a string" do
- assert_equal TestTestMailer, self.class.mailer_class
- end
- end
-end
-
-describe "Another Crazy Name Mailer Test" do
- tests TestTestMailer
-
- describe "nested" do
- it "gets the mailer after setting it manually" do
- assert_equal TestTestMailer, self.class.mailer_class
- end
- end
-end
-
-describe "Another Crazy Symbol Name Mailer Test" do
- tests :test_test_mailer
-
- describe "nested" do
- it "gets the mailer after setting it with a symbol" do
- assert_equal TestTestMailer, self.class.mailer_class
- end
- end
-end
-
-describe "Another Crazy String Name Mailer Test" do
- tests 'test_test_mailer'
-
- it "gets the mailer after setting it with a string" do
- assert_equal TestTestMailer, self.class.mailer_class
- end
-end
@@ -1,5 +1,25 @@
## Rails 4.0.0 (unreleased) ##
+* Allow to toggle dumps on error pages.
+
+ *Gosha Arinich*
+
+* Fix a bug in `content_tag_for` that prevents it for work without a block.
+
+ *Jasl*
+
+* Change the stylesheet of exception pages for development mode.
+ Additionally display also the line of code and fragment that raised
+ the exception in all exceptions pages.
+
+ *Guillermo Iguaran + Jorge Cuadrado*
+
+* Do not append `charset=` parameter when `head` is called with a
+ `:content_type` option.
+ Fix #8661.
+
+ *Yves Senn*
+
* Added `Mime::NullType` class. This allows to use html?, xml?, json?..etc when
the `format` of `request` is unknown, without raise an exception.
@@ -1,4 +1,4 @@
-Copyright (c) 2004-2012 David Heinemeier Hansson
+Copyright (c) 2004-2013 David Heinemeier Hansson
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@@ -31,6 +31,7 @@ def head(status, options = {})
if include_content?(self.status)
self.content_type = content_type || (Mime[formats.first] if formats)
+ self.response.charset = false if self.response
self.response_body = " "
else
headers.delete('Content-Type')
@@ -360,13 +360,6 @@ def exists?
#
# assert_redirected_to page_url(title: 'foo')
class TestCase < ActiveSupport::TestCase
-
- # Use AC::TestCase for the base class when describing a controller
- register_spec_type(self) do |desc|
- Class === desc && desc < ActionController::Metal
- end
- register_spec_type(/Controller( ?Test)?\z/i, self)
-
module Behavior
extend ActiveSupport::Concern
include ActionDispatch::TestProcess
@@ -1,5 +1,5 @@
#--
-# Copyright (c) 2004-2012 David Heinemeier Hansson
+# Copyright (c) 2004-2013 David Heinemeier Hansson
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -260,14 +260,18 @@ def assign_default_content_type_and_charset!(headers)
return if headers[CONTENT_TYPE].present?
@content_type ||= Mime::HTML
- @charset ||= self.class.default_charset
+ @charset ||= self.class.default_charset unless @charset == false
type = @content_type.to_s.dup
- type << "; charset=#{@charset}" unless @sending_file
+ type << "; charset=#{@charset}" if append_charset?
headers[CONTENT_TYPE] = type
end
+ def append_charset?
+ !@sending_file && @charset != false
+ end
+
def rack_response(status, header)
assign_default_content_type_and_charset!(header)
handle_conditional_get!
@@ -37,8 +37,7 @@ def clear
private
def extract_parameterized_parts(route, options, recall, parameterize = nil)
- constraints = recall.merge(options)
- data = constraints.dup
+ data = recall.merge(options)
keys_to_keep = route.parts.reverse.drop_while { |part|
!options.key?(part) || (options[part] || recall[part]).nil?
Oops, something went wrong.

0 comments on commit 47e0d3c

Please sign in to comment.