aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/test
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | Make ActionMailer frozen string literal friendly.Pat Allan2017-06-201-2/+2
| |/ /
| * | Allow mailers to configure their delivery jobMatthew Mongeau2017-06-151-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Setting delivery_job on a mailer class will cause MessageDelivery to use the specified job instead of ActionMailer::DeliveryJob: class MyMailer < ApplicationMailer self.delivery_job = MyCustomDeliveryJob ... end
* | | Merge branch 'master' into unlock-minitestKasper Timm Hansen2017-05-293-12/+8
|\| |
| * | Define path with __dir__bogdanvlviv2017-05-233-4/+4
| | | | | | | | | | | | | | | | | | ".. with __dir__ we can restore order in the Universe." - by @fxn Related to 5b8738c2df003a96f0e490c43559747618d10f5f
| * | Use recyclable cache keys (#29092)David Heinemeier Hansson2017-05-181-7/+3
| | |
| * | Should escape meta characters in regexpRyuta Kamizono2017-05-071-1/+1
| | |
* | | Avoid stubing on this testRafael Mendonça França2017-04-271-3/+2
|/ / | | | | | | | | This will avoid to the test fail when running in isolation because the message generated is nil.
* | 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).