| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
As @dhh brings up, the point of `ActionDispatch::IntegrationTest` is to
allow users to test the integration of all the pieces called by a
controller. Asserting about the emails and jobs queued is part of that
task.
This commit includes the `ActionMailer::TestHelper` and
`ActiveJob::TestHelper` modules when the ActionMailer and ActiveJob
railties are initialized respectively.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use attr_reader/attr_writer instead of methods
method is 12% slower
Use flat_map over map.flatten(1)
flatten is 66% slower
Use hash[]= instead of hash.merge! with single arguments
merge! is 166% slower
See https://github.com/rails/rails/pull/32337 for more conversation
|
|
|
|
| |
`assert_no_emails` is shortcut for `assert_emails 0, &block`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* ActionMailer::Base can unregister observer(s) and interceptor(s).
One or multiple mail observers can be unregistered using
`ActionMailer::Base.unregister_observers` or
`ActionMailer::Base.unregister_observer`.
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`.
* Ensure to be reset registered observer(s) and interceptor(s)
* Add explanation to CHANGELOG
* Add original author's name
[Kota Miyake + Rafael Mendonça França + Claudio Ortolina]
|
|\
| |
| |
| |
| | |
Small doc fixes
[ci skip]
|
| |
| |
| |
| | |
[ci skip]
|
|/ |
|
|
|
|
|
|
|
| |
- Remove extra execution of `perform_enqueued_jobs`
since it performs all enqueued jobs in the duration of the block.
- Fix example of using `assert_emails` without block since we
can't use enqueued jobs in this case.
|
|
|
|
| |
Perform enqueued delivery jobs in #assert_emails and #assert_no_emails.
|
|
|
|
| |
:tada::tada::tada:
|
|\
| |
| |
| | |
Fix actionmailer lambda default
|
| |
| |
| |
| |
| |
| |
| | |
PR #29270 changed the number of arguments that gets passed to Procs
defined in ActionMail::Base.default. With this changeset, Procs can
now have 1 or 0 arguments
Also adds test coverage for AM::Base.default Proc arity.
|
| |
| |
| |
| | |
[ci skip]
|
| |
| |
| |
| |
| |
| | |
- And move the Active Job related section down. Otherwise it was
appearing as if the options are available for the `delivery_job`
setting.
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| | |
This basically reverts cd9cc721ab54e2b0c7875cacf2113f03908a8bb7
|
| | |
|
|/ |
|
| |
|
|\
| |
| | |
Eager load controller actions to reduce response time of the first request
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
On the first request, ActionController::Base#action_methods computes
and memoized the list of available actions [1]. With this PR we move
this expensive operation into eager load step to reduce response time
of the first request served in production.
This also reduces the memory footprint when running on forking server
like Unicorn.
[1] https://github.com/rails/rails/blob/a3813dce9a0c950a4af7909111fa730a2622b1db/actionpack/lib/abstract_controller/base.rb#L66-L77
|
|/
|
|
|
| |
The comment was describing a previous version of the method with
a different signature. This is outdated since e76c38e
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Allow a default value to be declared for class_attribute
* Convert to using class_attribute default rather than explicit setter
* Removed instance_accessor option by mistake
* False is a valid default value
* Documentation
|
|\
| |
| | |
Pass request params to ActionMailer::Preview
|
| | |
|
| | |
|
|/ |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ActionMailer::Base#instrument_name and
ActionController::Base#instrument_name will be frequently called once
caching is enabled. So it's better to freeze them instead of create new
string on every call.
Also, the instrument name in #instrument_fragment_cache will usually
be "write_fragment.action_controller" or
"read_fragment.action_controller". So freezing them might also gain some
performance improvement. We have done something like this in other places:
https://github.com/rails/rails/blob/master/actionview/lib/action_view/template.rb#L348
|
| |
|
|
|
|
|
|
|
|
| |
The raw_source method is documented as returning the exact value that
was used to create the body; mutating it breaks that contract.
Additionally, if the value used to create the body is blank, raw_source
returns a frozen string which causes the interceptor to raise an error.
|
| |
|
|
|
|
|
| |
Also change the class_methods to ClassMethods since the former document
the method as an instance method of Parameterized not as a class method.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
We own the class so we can override the initialize.
|
| |
|
|
|
|
|
|
| |
parameterized delivery jobs
Needed for testing of parameterized mailers
|