aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/test
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #28244 from ixti/improve/action-mailer-preview-paramsRafael França2017-04-261-0/+16
|\ | | | | Pass request params to ActionMailer::Preview
| * Pass request params to ActionMailer::PreviewAlexey Zapparov2017-03-011-0/+16
| |
* | Remove duplicated `delivery_method` definitionyuuji.yaginuma2017-04-071-1/+0
| | | | | | | | | | `ActionMailer::Base.delivery_method` is already defined in https://github.com/rails/rails/blob/master/actionmailer/test/parameterized_test.rb#L13
* | Use better duration aliases in testsAndrew White2017-03-151-2/+2
| |
* | Don't cast to float unnecessarilyAndrew White2017-03-151-2/+2
| | | | | | | | Adding durations to `Time` instances is perfectly okay.
* | Deprecate implicit coercion of `ActiveSupport::Duration`Andrew White2017-03-021-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently `ActiveSupport::Duration` implicitly converts to a seconds value when used in a calculation except for the explicit examples of addition and subtraction where the duration is the receiver, e.g: >> 2 * 1.day => 172800 This results in lots of confusion especially when using durations with dates because adding/subtracting a value from a date treats integers as a day and not a second, e.g: >> Date.today => Wed, 01 Mar 2017 >> Date.today + 2 * 1.day => Mon, 10 Apr 2490 To fix this we're implementing `coerce` so that we can provide a deprecation warning with the intent of removing the implicit coercion in Rails 5.2, e.g: >> 2 * 1.day DEPRECATION WARNING: Implicit coercion of ActiveSupport::Duration to a Numeric is deprecated and will raise a TypeError in Rails 5.2. => 172800 In Rails 5.2 it will raise `TypeError`, e.g: >> 2 * 1.day TypeError: ActiveSupport::Duration can't be coerced into Integer This is the same behavior as with other types in Ruby, e.g: >> 2 * "foo" TypeError: String can't be coerced into Integer >> "foo" * 2 => "foofoo" As part of this deprecation add `*` and `/` methods to `AS::Duration` so that calculations that keep the duration as the receiver work correctly whether the final receiver is a `Date` or `Time`, e.g: >> Date.today => Wed, 01 Mar 2017 >> Date.today + 1.day * 2 => Fri, 03 Mar 2017 Fixes #27457.
* Add `:args` to `process.action_mailer` eventyuuji.yaginuma2017-02-041-0/+19
|
* Avoid should in test namesRafael Mendonça França2017-01-301-1/+1
|
* Implement respond_to_missing? in the Parameterized::Mailer classRafael Mendonça França2017-01-301-0/+14
|
* Make assert_enqueued_emails + assert_no_enqueued_emails consider ↵David Heinemeier Hansson2017-01-301-0/+18
| | | | | | parameterized delivery jobs Needed for testing of parameterized mailers
* restore `delivery_method` after testyuuji.yaginuma2017-01-291-4/+1
| | | | | Currently use two variables to restore `delivery_method`, but the order of restoring the values is incorrect and does not restore is correctly.
* Offer the option to use parameterization for shared processing of headers ↵David Heinemeier Hansson2017-01-282-0/+55
| | | | | and ivars (#27825) Offer the option to use parameterization for shared processing of headers and ivars
* Don't pollute Object with rubinius_skip and jruby_skipAkira Matsuda2017-01-171-9/+9
| | | | we call them only in the tests
* Reduce string objects by using \ instead of + or << for concatenating stringsAkira Matsuda2017-01-121-5/+5
| | | | (I personally prefer writing one string in one line no matter how long it is, though)
* Use Encoding::UTF_8 constant for default_{internal,external} in the testsAkira Matsuda2017-01-111-2/+2
|
* Merge pull request #27227 from MQuy/allow-custom-content-type-in-mail-bodyRafael Mendonça França2017-01-061-0/+5
|\ | | | | | | Allow to custom content type when setting mailer body
| * Fix wrong typo in testMQuy2016-12-051-1/+1
| |
| * allow context type when set body mailMQuy2016-11-301-0/+5
| |
* | Remove unneeded Deprecation.silenceRafael Mendonça França2017-01-031-3/+1
| |
* | Privatize unneededly protected methods in Action Mailer testsAkira Matsuda2016-12-243-3/+3
|/
* Add more rubocop rules about whitespacesRafael Mendonça França2016-10-294-9/+9
|
* Remove deprecated support to :text in renderRafael Mendonça França2016-10-103-6/+6
|
* Add three new rubocop rulesRafael Mendonça França2016-08-165-19/+19
| | | | | | | | Style/SpaceBeforeBlockBraces Style/SpaceInsideBlockBraces Style/SpaceInsideHashLiteralBraces Fix all violations in the repository.
* code gardening: removes redundant selfsXavier Noria2016-08-081-2/+2
| | | | | | | | | A few have been left for aesthetic reasons, but have made a pass and removed most of them. Note that if the method `foo` returns an array, `foo << 1` is a regular push, nothing to do with assignments, so no self required.
* Modify LogSubscriber for single partial's cache message.Stan Lo2016-08-081-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement naive partial caching mechanism. Add test for LogSubscriber Use ActionView::Base#log_payload to store log_subscriber's payload, so we can pass cache result into it. Fixed tests Remove useless settings Check if #log_payload exists before calling it. Because other classes also includes CacheHelper but don't have is attribute Use @log_payload_for_partial_reder instead of #log_payload to carry ActionView's payload. Update test's hash syntax Add configuration to enable/disable fragment caching logging Remove unless test and add new test to ensure cache info won't effect next rendering's log Move :enable_fragment_cache_logging config from ActionView to ActionPack Apply new config to tests Update actionview's changelog Update configuration guide Improve actionview's changelog Refactor PartialRenderer#render and log tests Mute subscriber's log instead of disabling instrumentation. Fix typo, remove useless comment and use new hash syntax Improve actionpack's log_subscriber test Fix rebase mistake Apply new config to all caching intstrument actions
* Add `Style/EmptyLines` in `.rubocop.yml` and remove extra empty linesRyuta Kamizono2016-08-071-1/+0
|
* applies remaining conventions across the projectXavier Noria2016-08-063-4/+2
|
* normalizes indentation and whitespace across the projectXavier Noria2016-08-065-23/+23
|
* applies new string literal convention in actionmailer/testXavier Noria2016-08-0617-257/+257
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Action Mailer: Declarative exception handling with `rescue_from`.Jeremy Daer2016-05-152-1/+70
| | | | | | | | | | | | | | | | | | | | | | | Follows the same pattern as controllers and jobs. Exceptions raised in delivery jobs (enqueued by `#deliver_later`) are also delegated to the mailer's rescue_from handlers, so you can handle the DeserializationError raised by delivery jobs: ```ruby class MyMailer < ApplicationMailer rescue_from ActiveJob::DeserializationError do … end ``` ActiveSupport::Rescuable polish: * Add the `rescue_with_handler` class method so exceptions may be handled at the class level without requiring an instance. * Rationalize `exception.cause` handling. If no handler matches the exception, fall back to the handler that matches its cause. * Handle exceptions raised elsewhere. Pass `object: …` to execute the `rescue_from` handler (e.g. a method call or a block to instance_exec) against a different object. Defaults to `self`.
* Merge pull request #24589 from vipulnsward/am-fragment-cacheRafael França2016-05-055-3/+62
|\ | | | | Expand on Action Mailer Fragment caching tests
| * Expand on Action Mailer Fragment caching testsVipul A M2016-04-175-3/+62
| |
* | Clear ActionMailer deliveries on setup and teardownarktisklada2016-04-251-0/+38
|/ | | | Signed-off-by: Jeremy Daer <jeremydaer@gmail.com>
* Disallow calling `#deliver_later` after local message modifications.Jeremy Daer2016-04-071-0/+8
| | | | | | | | | | | | | | | | | | | They would be lost when the delivery job is enqueued, otherwise. Prevents a common, hard-to-find bug like: ```ruby message = Notifier.welcome(user, foo) message.message_id = my_generated_message_id message.deliver_later ``` The message_id is silently lost here! *Only the mailer arguments are passed to the delivery job.* This raises an exception now. Make modifications to the message within the mailer method or use a custom Active Job to manage delivery instead of using #deliver_later.
* Sendmail default arguments match Mail::SendMailarktisklada2016-04-051-1/+1
| | | | Removes `-t`
* Suppress warningsyui-knk2016-03-312-6/+12
| | | | | "Using a dynamic :controller (or :action) segment in a route is deprecated" by 6520ea5f7e2215a763ca74bf6cfa87be2347d5df (#23980).
* Remove load_paths fileArthur Neves2016-02-271-1/+0
|
* Move ActionMailer::Caching's content into ActionMailer::Base instead of ↵Stan Lo2016-02-231-2/+0
| | | | | | including it Remove useless helper in ActionDispatch::Caching and fix indentation
* Move most caching methods to ActionDispatch::Caching, and let ActionMailer ↵Stan Lo2016-02-231-1/+0
| | | | and ActionController to include it
* Porting ActionController::Caching to ActionMailer::CachingStan Lo2016-02-236-0/+257
|
* Remove not used test fixtureyui-knk2015-12-301-1/+0
| | | | | | 'actionmailer/test/mailers/async_mailer.rb' was deleted by f9da785d0b1b22317cfca25c15fb555e9016accb . This template is not used now.
* Revert "Merge pull request #18446 from ↵Sean Griffin2015-11-231-78/+0
| | | | | | | | | cloud8421/actionmailer-unregister-interceptor" This reverts commit 65a61ab7c370d2894c11ce276725f723a5c9c111, reversing changes made to 14314ca18302f18c3d8bb7a63e9f71ac4c2290c2. This PR broke the build
* Merge pull request #18446 from cloud8421/actionmailer-unregister-interceptorSean Griffin2015-11-231-0/+78
|\ | | | | | | ActionMailer::Base can unregister interceptor(s).
| * ActionMailer::Base can unregister interceptor(s).Claudio Ortolina2015-01-311-0/+78
| | | | | | | | | | | | | | | | | | | | | | | | One or multiple mail interceptors can be unregistered using `ActionMailer::Base.unregister_interceptors` or `ActionMailer::Base.unregister_interceptor`. For preview interceptors, it's possible to use `ActionMailer::Base.unregister_preview_interceptors` or `ActionMailer::Base.unregister_preview_interceptor`. Refactors logic to constantize a string/symbol into separate method.
* | tests, define `Rails.root` before loading Action Mailer.Yves Senn2015-11-042-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since `bin/test` would define `Rails.root` before loading AM but `bundle exec rake` would define it after loading AM, this lead to the following test failure when using `bin/test`: ``` --- expected +++ actual @@ -1 +1 @@ -{:location=>"/var/folders/_r/9kh50y4j0vn7zgg2p65z1lcm0000gn/T/mails"} +{:location=>"/Users/senny/Projects/rails/actionmailer/tmp/mails"} ``` This patch ensures that `Rails.root` is defined when loading AM to achieve consistent test results.
* | Delete needless `require 'active_support/deprecation'`yui-knk2015-10-201-1/+0
| | | | | | | | | | When `require 'active_support/rails'`, 'active_support/deprecation' is automatically loaded.
* | Added assertion for error messages for nil and unknown delivery methodsRonak Jangir2015-09-221-2/+4
| | | | | | As `deliver_now` `RuntimeError` for both nil & unknown delivery method so it’s good to have assertion for error messages
* | change test method name to the appropriate nameyuuji.yaginuma2015-09-191-1/+1
| |
* | Added test for `any` if called without specifying any format Ronak Jangir2015-09-182-0/+13
| | | | | | | | | | | | | | | | Example ````ruby mail(hash) do |format| format.any end ````
* | Removed duplicate requiring minitest/mock as it is already required in ↵Ronak Jangir2015-08-261-1/+0
| | | | | | | | method_call_assertions