Permalink
Browse files

Merge

  • Loading branch information...
dhh committed Jan 4, 2010
2 parents d7d9173 + eca11bf commit 5e94d3e3ea06e577d97a32eb4b38b61c4ce8ff8f
Showing with 2,812 additions and 2,441 deletions.
  1. +5 −4 actionmailer/CHANGELOG
  2. +1 −1 actionmailer/actionmailer.gemspec
  3. +1 −1 actionmailer/lib/action_mailer/base.rb
  4. +1,467 −1,466 actionmailer/lib/action_mailer/vendor/text-format-0.6.3/text/format.rb
  5. +9 −9 actionmailer/test/mail_layout_test.rb
  6. +44 −44 actionmailer/test/mail_service_test.rb
  7. +1 −1 actionmailer/test/quoting_test.rb
  8. +2 −2 actionmailer/test/test_helper_test.rb
  9. +2 −2 actionmailer/test/tmail_compat_test.rb
  10. +2 −2 actionpack/lib/action_controller/caching.rb
  11. +8 −6 actionpack/lib/action_controller/caching/fragments.rb
  12. +6 −2 actionpack/lib/action_controller/caching/pages.rb
  13. +4 −3 actionpack/lib/action_controller/metal/logger.rb
  14. +1 −1 actionpack/lib/action_dispatch/middleware/session/cookie_store.rb
  15. +22 −2 actionpack/lib/action_dispatch/middleware/show_exceptions.rb
  16. +1 −0 actionpack/lib/action_view/base.rb
  17. +39 −3 actionpack/lib/action_view/helpers/form_helper.rb
  18. +4 −3 actionpack/lib/action_view/render/partials.rb
  19. +3 −2 actionpack/lib/action_view/render/rendering.rb
  20. +4 −1 actionpack/test/abstract_unit.rb
  21. +3 −4 actionpack/test/activerecord/controller_runtime_test.rb
  22. +8 −8 actionpack/test/controller/caching_test.rb
  23. +2 −1 actionpack/test/controller/logging_test.rb
  24. +23 −0 actionpack/test/dispatch/show_exceptions_test.rb
  25. +1 −0 actionpack/test/lib/controller/fake_models.rb
  26. +40 −0 actionpack/test/template/form_helper_test.rb
  27. +6 −5 activemodel/lib/active_model/errors.rb
  28. +14 −0 activemodel/lib/active_model/lint.rb
  29. +3 −0 activemodel/lib/active_model/locale/en.yml
  30. +2 −1 activemodel/lib/active_model/validator.rb
  31. +2 −0 activemodel/test/cases/lint_test.rb
  32. +7 −15 activemodel/test/cases/validations/i18n_validation_test.rb
  33. +47 −0 activemodel/test/cases/validations/with_validation_test.rb
  34. +6 −0 activemodel/test/cases/validations_test.rb
  35. +5 −0 activerecord/CHANGELOG
  36. +1 −0 activerecord/lib/active_record.rb
  37. +1 −80 activerecord/lib/active_record/associations.rb
  38. +2 −2 activerecord/lib/active_record/associations/association_collection.rb
  39. +1 −1 activerecord/lib/active_record/autosave_association.rb
  40. +13 −21 activerecord/lib/active_record/base.rb
  41. +1 −1 activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
  42. +3 −0 activerecord/lib/active_record/locale/en.yml
  43. +1 −1 activerecord/lib/active_record/named_scope.rb
  44. +1 −1 activerecord/lib/active_record/railtie.rb
  45. +55 −32 activerecord/lib/active_record/relation.rb
  46. +8 −0 activerecord/lib/active_record/relation/query_methods.rb
  47. +85 −0 activerecord/lib/active_record/relation/spawn_methods.rb
  48. +24 −7 activerecord/test/cases/autosave_association_test.rb
  49. +6 −0 activerecord/test/cases/multiple_db_test.rb
  50. +1 −1 activerecord/test/cases/nested_attributes_test.rb
  51. +88 −1 activerecord/test/cases/relations_test.rb
  52. +2 −2 activesupport/lib/active_support/cache.rb
  53. +1 −1 activesupport/lib/active_support/core_ext/integer/multiple.rb
  54. +5 −0 activesupport/test/core_ext/integer_ext_test.rb
  55. +3 −3 activesupport/test/isolation_test.rb
  56. +1 −1 rack
  57. +1 −14 railties/lib/rails/application.rb
  58. +57 −93 railties/lib/rails/generators.rb
  59. +33 −29 railties/lib/rails/generators/base.rb
  60. +11 −3 railties/lib/rails/generators/rails/app/app_generator.rb
  61. +1 −1 railties/lib/rails/generators/rails/app/templates/config/application.rb
  62. +239 −0 railties/lib/rails/generators/test_case.rb
  63. +2 −2 railties/lib/rails/generators/test_unit/scaffold/templates/functional_test.rb
  64. +0 −3 railties/lib/rails/vendor/thor-0.12.1/lib/thor/version.rb
  65. +5 −7 railties/lib/rails/vendor/{thor-0.12.1 → thor-0.12.3}/CHANGELOG.rdoc
  66. 0 railties/lib/rails/vendor/{thor-0.12.1 → thor-0.12.3}/LICENSE
  67. 0 railties/lib/rails/vendor/{thor-0.12.1 → thor-0.12.3}/README.rdoc
  68. 0 railties/lib/rails/vendor/{thor-0.12.1 → thor-0.12.3}/Thorfile
  69. +41 −43 railties/lib/rails/vendor/{thor-0.12.1 → thor-0.12.3}/lib/thor.rb
  70. +8 −7 railties/lib/rails/vendor/{thor-0.12.1 → thor-0.12.3}/lib/thor/actions.rb
  71. +2 −2 railties/lib/rails/vendor/{thor-0.12.1 → thor-0.12.3}/lib/thor/actions/create_file.rb
  72. 0 railties/lib/rails/vendor/{thor-0.12.1 → thor-0.12.3}/lib/thor/actions/directory.rb
  73. 0 railties/lib/rails/vendor/{thor-0.12.1 → thor-0.12.3}/lib/thor/actions/empty_directory.rb
  74. +4 −4 railties/lib/rails/vendor/{thor-0.12.1 → thor-0.12.3}/lib/thor/actions/file_manipulation.rb
  75. +2 −2 railties/lib/rails/vendor/{thor-0.12.1 → thor-0.12.3}/lib/thor/actions/inject_into_file.rb
  76. +30 −32 railties/lib/rails/vendor/{thor-0.12.1 → thor-0.12.3}/lib/thor/base.rb
  77. +9 −0 railties/lib/rails/vendor/thor-0.12.3/lib/thor/core_ext/file_binary_read.rb
  78. +1 −1 ...es/lib/rails/vendor/{thor-0.12.1 → thor-0.12.3}/lib/thor/core_ext/hash_with_indifferent_access.rb
  79. 0 railties/lib/rails/vendor/{thor-0.12.1 → thor-0.12.3}/lib/thor/core_ext/ordered_hash.rb
  80. 0 railties/lib/rails/vendor/{thor-0.12.1 → thor-0.12.3}/lib/thor/error.rb
  81. +25 −21 railties/lib/rails/vendor/{thor-0.12.1 → thor-0.12.3}/lib/thor/group.rb
  82. 0 railties/lib/rails/vendor/{thor-0.12.1 → thor-0.12.3}/lib/thor/invocation.rb
  83. 0 railties/lib/rails/vendor/{thor-0.12.1 → thor-0.12.3}/lib/thor/parser.rb
  84. 0 railties/lib/rails/vendor/{thor-0.12.1 → thor-0.12.3}/lib/thor/parser/argument.rb
  85. 0 railties/lib/rails/vendor/{thor-0.12.1 → thor-0.12.3}/lib/thor/parser/arguments.rb
  86. +1 −1 railties/lib/rails/vendor/{thor-0.12.1 → thor-0.12.3}/lib/thor/parser/option.rb
  87. 0 railties/lib/rails/vendor/{thor-0.12.1 → thor-0.12.3}/lib/thor/parser/options.rb
  88. 0 railties/lib/rails/vendor/{thor-0.12.1 → thor-0.12.3}/lib/thor/rake_compat.rb
  89. +45 −41 railties/lib/rails/vendor/{thor-0.12.1 → thor-0.12.3}/lib/thor/runner.rb
  90. +1 −1 railties/lib/rails/vendor/{thor-0.12.1 → thor-0.12.3}/lib/thor/shell.rb
  91. +48 −28 railties/lib/rails/vendor/{thor-0.12.1 → thor-0.12.3}/lib/thor/shell/basic.rb
  92. +1 −1 railties/lib/rails/vendor/{thor-0.12.1 → thor-0.12.3}/lib/thor/shell/color.rb
  93. +32 −43 railties/lib/rails/vendor/{thor-0.12.1 → thor-0.12.3}/lib/thor/task.rb
  94. +4 −22 railties/lib/rails/vendor/{thor-0.12.1 → thor-0.12.3}/lib/thor/util.rb
  95. +3 −0 railties/lib/rails/vendor/thor-0.12.3/lib/thor/version.rb
  96. +5 −0 railties/test/application/configuration_test.rb
  97. +3 −9 railties/test/generators/actions_test.rb
  98. +21 −18 railties/test/generators/app_generator_test.rb
  99. +4 −11 railties/test/generators/controller_generator_test.rb
  100. +1 −8 railties/test/generators/generator_generator_test.rb
  101. +11 −81 railties/test/generators/generators_test_helper.rb
  102. +1 −8 railties/test/generators/helper_generator_test.rb
  103. +1 −8 railties/test/generators/integration_test_generator_test.rb
  104. +1 −8 railties/test/generators/mailer_generator_test.rb
  105. +1 −8 railties/test/generators/metal_generator_test.rb
  106. +16 −25 railties/test/generators/migration_generator_test.rb
  107. +4 −11 railties/test/generators/model_generator_test.rb
  108. +4 −4 railties/test/generators/named_base_test.rb
  109. +1 −8 railties/test/generators/observer_generator_test.rb
  110. +1 −8 railties/test/generators/performance_test_generator_test.rb
  111. +1 −8 railties/test/generators/plugin_generator_test.rb
  112. +3 −10 railties/test/generators/resource_generator_test.rb
  113. +10 −17 railties/test/generators/scaffold_controller_generator_test.rb
  114. +9 −19 railties/test/generators/scaffold_generator_test.rb
  115. +0 −9 railties/test/generators/session_migration_generator_test.rb
  116. +1 −10 railties/test/generators/stylesheets_generator_test.rb
  117. +9 −8 railties/test/generators_test.rb
View
@@ -1,13 +1,14 @@
*Rails 3.0 (pending)*
-* ActionMailer::Base :default_implicit_parts_order now is in the sequence of the order you want, no reversing of ordering takes place. The default order now is text/plain, then text/enriched, then text/html and then any other part that is not one of these three.
+* The Mail::Message class has helped methods for all the field types that return 'common' defaults for the common use case, so to get the subject, mail.subject will give you a string, mail.date will give you a DateTime object, mail.from will give you an array of address specs (mikel@test.lindsaar.net) etc. If you want to access the field object itself, call mail[:field_name] which will return the field object you want, which you can then chain, like mail[:from].formatted
-* Mail does not have "quoted_body", "quoted_subject" etc. All of these are accessed via body.encoded, subject.encoded etc
+* Mail#content_type now returns the content_type field as a string. If you want the mime type of a mail, then you call Mail#mime_type (eg, text/plain), if you want the parameters of the content type field, you call Mail#content_type_parameters which gives you a hash, eg {'format' => 'flowed', 'charset' => 'utf-8'}
-* Every part of a Mail object returns an object, never a string. So Mail.body returns a Mail::Body class object, need to call #encoded or #decoded to get the string you want.
+* ActionMailer::Base :default_implicit_parts_order now is in the sequence of the order you want, no reversing of ordering takes place. The default order now is text/plain, then text/enriched, then text/html and then any other part that is not one of these three.
-* By default, a field will return the #decoded value when you send it :to_s and any object that is a container (like header, body etc) will return #encoded value when you send it :to_s
+* Mail does not have "quoted_body", "quoted_subject" etc. All of these are accessed via body.encoded, subject.encoded etc
+* Every object in a Mail object returns an object, never a string. So Mail.body returns a Mail::Body class object, need to call #encoded or #decoded to get the string you want.
* Mail::Message#set_content_type does not exist, it is simply Mail::Message#content_type
* Every mail message gets a unique message_id unless you specify one, had to change all the tests that check for equality with expected.encoded == actual.encoded to first replace their message_ids with control values
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
s.homepage = "http://www.rubyonrails.org"
s.add_dependency('actionpack', '= 3.0.pre')
- s.add_dependency('mail', '~> 1.4.3')
+ s.add_dependency('mail', '~> 1.5.0')
s.files = Dir['CHANGELOG', 'README', 'MIT-LICENSE', 'lib/**/*']
s.has_rdoc = true
@@ -500,7 +500,7 @@ def deliver!(mail = @mail)
logger.debug "\n#{mail.encoded}"
end
- ActiveSupport::Notifications.instrument(:deliver_mail, :mail => mail) do
+ ActiveSupport::Notifications.instrument("action_mailer.deliver", :mail => mail) do
begin
self.delivery_method.perform_delivery(mail) if perform_deliveries
rescue Exception => e # Net::SMTP errors or sendmail pipe errors

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -72,20 +72,20 @@ def test_should_pickup_multipart_layout
mail = AutoLayoutMailer.create_multipart(@recipient)
# CHANGED: content_type returns an object
# assert_equal "multipart/alternative", mail.content_type
- assert_equal "multipart/alternative", mail.content_type.string
+ assert_equal "multipart/alternative", mail.mime_type
assert_equal 2, mail.parts.size
# CHANGED: content_type returns an object
# assert_equal 'text/plain', mail.parts.first.content_type
- assert_equal 'text/plain', mail.parts.first.content_type.string
+ assert_equal 'text/plain', mail.parts.first.mime_type
# CHANGED: body returns an object
# assert_equal "text/plain layout - text/plain multipart", mail.parts.first.body
assert_equal "text/plain layout - text/plain multipart", mail.parts.first.body.to_s
# CHANGED: content_type returns an object
# assert_equal 'text/html', mail.parts.last.content_type
- assert_equal 'text/html', mail.parts.last.content_type.string
+ assert_equal 'text/html', mail.parts.last.mime_type
# CHANGED: body returns an object
# assert_equal "Hello from layout text/html multipart", mail.parts.last.body
@@ -96,33 +96,33 @@ def test_should_pickup_multipartmixed_layout
mail = AutoLayoutMailer.create_multipart(@recipient, "multipart/mixed")
# CHANGED: content_type returns an object
# assert_equal "multipart/mixed", mail.content_type
- assert_equal "multipart/mixed", mail.content_type.string
+ assert_equal "multipart/mixed", mail.mime_type
assert_equal 2, mail.parts.size
# CHANGED: content_type returns an object
# assert_equal 'text/plain', mail.parts.first.content_type
- assert_equal 'text/plain', mail.parts.first.content_type.string
+ assert_equal 'text/plain', mail.parts.first.mime_type
# CHANGED: body returns an object
# assert_equal "text/plain layout - text/plain multipart", mail.parts.first.body
assert_equal "text/plain layout - text/plain multipart", mail.parts.first.body.to_s
# CHANGED: content_type returns an object
# assert_equal 'text/html', mail.parts.last.content_type
- assert_equal 'text/html', mail.parts.last.content_type.string
+ assert_equal 'text/html', mail.parts.last.mime_type
# CHANGED: body returns an object
# assert_equal "Hello from layout text/html multipart", mail.parts.last.body
assert_equal "Hello from layout text/html multipart", mail.parts.last.body.to_s
end
def test_should_fix_multipart_layout
mail = AutoLayoutMailer.create_multipart(@recipient, "text/plain")
- assert_equal "multipart/alternative", mail.content_type.string
+ assert_equal "multipart/alternative", mail.mime_type
assert_equal 2, mail.parts.size
- assert_equal 'text/plain', mail.parts.first.content_type.string
+ assert_equal 'text/plain', mail.parts.first.mime_type
assert_equal "text/plain layout - text/plain multipart", mail.parts.first.body.to_s
- assert_equal 'text/html', mail.parts.last.content_type.string
+ assert_equal 'text/html', mail.parts.last.mime_type
assert_equal "Hello from layout text/html multipart", mail.parts.last.body.to_s
end
@@ -362,13 +362,13 @@ def test_nested_parts
assert_equal 2, created.parts.size
assert_equal 2, created.parts.first.parts.size
- assert_equal "multipart/mixed", created.content_type.string
- assert_equal "multipart/alternative", created.parts[0].content_type.string
+ assert_equal "multipart/mixed", created.mime_type
+ assert_equal "multipart/alternative", created.parts[0].mime_type
assert_equal "bar", created.parts[0].header['foo'].to_s
assert_nil created.parts[0].charset
- assert_equal "text/plain", created.parts[0].parts[0].content_type.string
- assert_equal "text/html", created.parts[0].parts[1].content_type.string
- assert_equal "application/octet-stream", created.parts[1].content_type.string
+ assert_equal "text/plain", created.parts[0].parts[0].mime_type
+ assert_equal "text/html", created.parts[0].parts[1].mime_type
+ assert_equal "application/octet-stream", created.parts[1].mime_type
end
@@ -380,11 +380,11 @@ def test_nested_parts_with_body
assert_equal 1,created.parts.size
assert_equal 2,created.parts.first.parts.size
- assert_equal "multipart/mixed", created.content_type.string
- assert_equal "multipart/alternative", created.parts.first.content_type.string
- assert_equal "text/plain", created.parts.first.parts.first.content_type.string
+ assert_equal "multipart/mixed", created.mime_type
+ assert_equal "multipart/alternative", created.parts.first.mime_type
+ assert_equal "text/plain", created.parts.first.parts.first.mime_type
assert_equal "Nothing to see here.", created.parts.first.parts.first.body.to_s
- assert_equal "text/html", created.parts.first.parts.second.content_type.string
+ assert_equal "text/html", created.parts.first.parts.second.mime_type
assert_equal "<b>test</b> HTML<br/>", created.parts.first.parts.second.body.to_s
end
@@ -468,8 +468,8 @@ def test_custom_templating_extension
assert_nothing_raised { created = TestMailer.create_custom_templating_extension(@recipient) }
assert_not_nil created
assert_equal 2, created.parts.length
- assert_equal 'text/plain', created.parts[0].content_type.string
- assert_equal 'text/html', created.parts[1].content_type.string
+ assert_equal 'text/plain', created.parts[0].mime_type
+ assert_equal 'text/html', created.parts[1].mime_type
end
def test_cancelled_account
@@ -731,8 +731,8 @@ def test_unquote_quoted_printable_subject
The body
EOF
mail = Mail.new(msg)
- assert_equal "testing testing \326\244", mail.subject.to_s
- assert_equal "Subject: =?utf-8?Q?testing_testing_=D6=A4?=\r\n", mail.subject.encoded
+ assert_equal "testing testing \326\244", mail.subject
+ assert_equal "Subject: =?utf-8?Q?testing_testing_=D6=A4?=\r\n", mail[:subject].encoded
end
def test_unquote_7bit_subject
@@ -744,8 +744,8 @@ def test_unquote_7bit_subject
The body
EOF
mail = Mail.new(msg)
- assert_equal "this == working?", mail.subject.to_s
- assert_equal "Subject: this == working?\r\n", mail.subject.encoded
+ assert_equal "this == working?", mail.subject
+ assert_equal "Subject: this == working?\r\n", mail[:subject].encoded
end
def test_unquote_7bit_body
@@ -868,7 +868,7 @@ def test_receive_attachments
mail = Mail.new(fixture)
attachment = mail.attachments.last
assert_equal "smime.p7s", attachment.original_filename
- assert_equal "application/pkcs7-signature", mail.parts.last.content_type.string
+ assert_equal "application/pkcs7-signature", mail.parts.last.mime_type
end
def test_decode_attachment_without_charset
@@ -913,7 +913,7 @@ def test_decode_message_with_incorrect_charset
def test_multipart_with_mime_version
mail = TestMailer.create_multipart_with_mime_version(@recipient)
- assert_equal "1.1", mail.mime_version.version
+ assert_equal "1.1", mail.mime_version
end
def test_multipart_with_utf8_subject
@@ -929,29 +929,29 @@ def test_implicitly_multipart_with_utf8
def test_explicitly_multipart_messages
mail = TestMailer.create_explicitly_multipart_example(@recipient)
assert_equal 3, mail.parts.length
- assert_equal 'multipart/mixed', mail.content_type.string
- assert_equal "text/plain", mail.parts[0].content_type.string
+ assert_equal 'multipart/mixed', mail.mime_type
+ assert_equal "text/plain", mail.parts[0].mime_type
- assert_equal "text/html", mail.parts[1].content_type.string
+ assert_equal "text/html", mail.parts[1].mime_type
assert_equal "iso-8859-1", mail.parts[1].charset
- assert_equal "image/jpeg", mail.parts[2].content_type.string
- assert_equal "attachment", mail.parts[2].content_disposition.disposition_type
- assert_equal "foo.jpg", mail.parts[2].content_disposition.filename
- assert_equal "foo.jpg", mail.parts[2].content_type.filename
+ assert_equal "image/jpeg", mail.parts[2].mime_type
+ assert_equal "attachment", mail.parts[2][:content_disposition].disposition_type
+ assert_equal "foo.jpg", mail.parts[2][:content_disposition].filename
+ assert_equal "foo.jpg", mail.parts[2][:content_type].filename
assert_nil mail.parts[2].charset
end
def test_explicitly_multipart_with_content_type
mail = TestMailer.create_explicitly_multipart_example(@recipient, "multipart/alternative")
assert_equal 3, mail.parts.length
- assert_equal "multipart/alternative", mail.content_type.string
+ assert_equal "multipart/alternative", mail.mime_type
end
def test_explicitly_multipart_with_invalid_content_type
mail = TestMailer.create_explicitly_multipart_example(@recipient, "text/xml")
assert_equal 3, mail.parts.length
- assert_equal 'multipart/mixed', mail.content_type.string
+ assert_equal 'multipart/mixed', mail.mime_type
end
def test_implicitly_multipart_messages
@@ -960,12 +960,12 @@ def test_implicitly_multipart_messages
mail = TestMailer.create_implicitly_multipart_example(@recipient)
assert_equal 3, mail.parts.length
assert_equal "1.0", mail.mime_version.to_s
- assert_equal "multipart/alternative", mail.content_type.string
- assert_equal "text/plain", mail.parts[0].content_type.string
+ assert_equal "multipart/alternative", mail.mime_type
+ assert_equal "text/plain", mail.parts[0].mime_type
assert_equal "utf-8", mail.parts[0].charset
- assert_equal "text/html", mail.parts[1].content_type.string
+ assert_equal "text/html", mail.parts[1].mime_type
assert_equal "utf-8", mail.parts[1].charset
- assert_equal "application/x-yaml", mail.parts[2].content_type.string
+ assert_equal "application/x-yaml", mail.parts[2].mime_type
assert_equal "utf-8", mail.parts[2].charset
end
@@ -974,24 +974,24 @@ def test_implicitly_multipart_messages_with_custom_order
mail = TestMailer.create_implicitly_multipart_example(@recipient, nil, ["application/x-yaml", "text/plain"])
assert_equal 3, mail.parts.length
- assert_equal "application/x-yaml", mail.parts[0].content_type.string
- assert_equal "text/plain", mail.parts[1].content_type.string
- assert_equal "text/html", mail.parts[2].content_type.string
+ assert_equal "application/x-yaml", mail.parts[0].mime_type
+ assert_equal "text/plain", mail.parts[1].mime_type
+ assert_equal "text/html", mail.parts[2].mime_type
end
def test_implicitly_multipart_messages_with_charset
mail = TestMailer.create_implicitly_multipart_example(@recipient, 'iso-8859-1')
assert_equal "multipart/alternative", mail.header['content-type'].content_type
- assert_equal 'iso-8859-1', mail.parts[0].content_type.parameters[:charset]
- assert_equal 'iso-8859-1', mail.parts[1].content_type.parameters[:charset]
- assert_equal 'iso-8859-1', mail.parts[2].content_type.parameters[:charset]
+ assert_equal 'iso-8859-1', mail.parts[0].content_type_parameters[:charset]
+ assert_equal 'iso-8859-1', mail.parts[1].content_type_parameters[:charset]
+ assert_equal 'iso-8859-1', mail.parts[2].content_type_parameters[:charset]
end
def test_html_mail
mail = TestMailer.create_html_mail(@recipient)
- assert_equal "text/html", mail.content_type.string
+ assert_equal "text/html", mail.mime_type
end
def test_html_mail_with_underscores
@@ -1043,7 +1043,7 @@ def test_recursive_multipart_processing
assert_equal(4, mail.parts.first.parts.length)
assert_equal("This is the first part.", mail.parts.first.parts.first.body.to_s)
assert_equal("test.rb", mail.parts.first.parts.second.filename)
- assert_equal("flowed", mail.parts.first.parts.fourth.content_type.parameters[:format])
+ assert_equal("flowed", mail.parts.first.parts.fourth.content_type_parameters[:format])
assert_equal('smime.p7s', mail.parts.second.filename)
end
@@ -1081,9 +1081,9 @@ def test_headers_with_nonalpha_chars
assert !mail.from_addrs.empty?
assert !mail.cc_addrs.empty?
assert !mail.bcc_addrs.empty?
- assert_match(/:/, mail.from_addrs.to_s)
- assert_match(/:/, mail.cc_addrs.to_s)
- assert_match(/:/, mail.bcc_addrs.to_s)
+ assert_match(/:/, mail[:from].decoded)
+ assert_match(/:/, mail[:cc].decoded)
+ assert_match(/:/, mail[:bcc].decoded)
end
def test_deliver_with_mail_object
@@ -1095,14 +1095,14 @@ def test_deliver_with_mail_object
def test_multipart_with_template_path_with_dots
mail = FunkyPathMailer.create_multipart_with_template_path_with_dots(@recipient)
assert_equal 2, mail.parts.length
- assert "text/plain", mail.parts[1].content_type.string
+ assert "text/plain", mail.parts[1].mime_type
assert "utf-8", mail.parts[1].charset
end
def test_custom_content_type_attributes
mail = TestMailer.create_custom_content_type_attributes
- assert_match %r{format="flowed"}, mail.content_type.encoded
- assert_match %r{charset="utf-8"}, mail.content_type.encoded
+ assert_match %r{format=flowed}, mail.content_type
+ assert_match %r{charset=utf-8}, mail.content_type
end
def test_return_path_with_create
@@ -78,7 +78,7 @@ def test_email_with_partially_quoted_subject
mail = Mail.new(IO.read("#{File.dirname(__FILE__)}/fixtures/raw_email_with_partially_quoted_subject"))
# CHANGED: subject returns an object now
# assert_equal "Re: Test: \"\346\274\242\345\255\227\" mid \"\346\274\242\345\255\227\" tail", mail.subject
- assert_equal "Re: Test: \"\346\274\242\345\255\227\" mid \"\346\274\242\345\255\227\" tail", mail.subject.decoded
+ assert_equal "Re: Test: \"\346\274\242\345\255\227\" mid \"\346\274\242\345\255\227\" tail", mail.subject
end
private
@@ -19,8 +19,8 @@ def test_setup_sets_right_action_mailer_options
def test_setup_creates_the_expected_mailer
assert @expected.is_a?(Mail::Message)
- assert_equal "1.0", @expected.mime_version.version
- assert_equal "text/plain", @expected.content_type.string
+ assert_equal "1.0", @expected.mime_version
+ assert_equal "text/plain", @expected.mime_type
end
def test_mailer_class_is_correctly_inferred
@@ -8,7 +8,7 @@ def test_set_content_type_raises_deprecation_warning
assert_nothing_raised do
mail.set_content_type "text/plain"
end
- assert_equal mail.content_type.string, "text/plain"
+ assert_equal mail.mime_type, "text/plain"
end
def test_transfer_encoding_raises_deprecation_warning
@@ -17,7 +17,7 @@ def test_transfer_encoding_raises_deprecation_warning
assert_nothing_raised do
mail.transfer_encoding "base64"
end
- assert_equal mail.content_transfer_encoding.value, "base64"
+ assert_equal mail.content_transfer_encoding, "base64"
end
end
@@ -62,9 +62,9 @@ def cache_configured?
end
def log_event(name, before, after, instrumenter_id, payload)
- if name.to_s =~ /(read|write|cache|expire|exist)_(fragment|page)\??/
+ if name.to_s =~ /action_controller\.((read|write|expire|exist)_(fragment|page)\??)/
key_or_path = payload[:key] || payload[:path]
- human_name = name.to_s.humanize
+ human_name = $1.humanize
duration = (after - before) * 1000
logger.info("#{human_name} #{key_or_path.inspect} (%.1fms)" % duration)
else
Oops, something went wrong.

0 comments on commit 5e94d3e

Please sign in to comment.